using SS.core;
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Drawing.Printing;
using System.Windows.Forms;
using TVSGPP.dir;
namespace SS
{
	public class FrmupdtProduct : Form
	{
		private IContainer components = null;
		private TextBox txtMinimumNumber;
		private TextBox txtRequestNumber;
		private TextBox txtreTailPrice;
		private Label label9;
		private TextBox txtSalePrice;
		private Label label8;
		private TextBox txtInputPrice;
		private Label label7;
		private ComboBox cbBCompany;
		private Label label4;
		private Label label1;
		private ComboBox cbbParentGID;
		private ComboBox cbbUnitProduct;
		private Button tSBClose;
		private Button tSBSave;
		private Button tSBAdd;
		private Button btnDel;
		private Button btnAddNewUnit;
		private Button btnFastGroupProduct;
		private DataGridView dgvRep;
		private ComboBox cbbSaveCondition;
		private CheckBox ckbLight;
		private CheckBox ckbKipChildren;
		private CheckBox ckbWarm;
		private ComboBox cbbList;
		private ComboBox cbbPosition;
		private Label lblPosition;
		private Button btnPossAdd;
		private TextBox txtSearch;
		private Label label2;
		private Button btnShowAll;
		private Button btnListUnit;
		private ImageList imageList1;
		private Label label5;
		private Label label15;
		private Label label14;
		private Label label11;
		private Label label6;
		private Label label10;
		private Label label12;
		private TextBox txtLiveDay;
		private Label label13;
		private TextBox txtDayNumberWarning;
		private Label label16;
		private TextBox txtNumberWarning;
		private Label label17;
		private Label label18;
		private ToolTip toolTip1;
		private Button btnAddSave;
		private Label label20;
		private Button btnSetBarcode;
		public TextBox txtBarcode;
		public TextBox txtName;
		public GroupBox groupBox2;
		private BindingNavigator bindingNavigator1;
		private ToolStripLabel bindingNavigatorCountItem;
		private ToolStripButton bindingNavigatorMoveFirstItem;
		private ToolStripButton bindingNavigatorMovePreviousItem;
		private ToolStripSeparator bindingNavigatorSeparator;
		private ToolStripTextBox bindingNavigatorPositionItem;
		private ToolStripSeparator bindingNavigatorSeparator1;
		private ToolStripButton bindingNavigatorMoveNextItem;
		private ToolStripButton bindingNavigatorMoveLastItem;
		private ToolStripSeparator bindingNavigatorSeparator2;
		private ContextMenuStrip contextMenuStrip1;
		private ToolStripMenuItem mnuUsage;
		private ToolStripMenuItem mnuIngredient;
		private CheckBox ckbSellWithBill;
		private CheckBox ckbFocusMind;
		private Label lblSpace;
		private ToolStripSeparator toolStripSeparator1;
		private ToolStripMenuItem mnuAdd;
		private ToolStripMenuItem mnuDel;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
		private ToolStripMenuItem mnuUnit;
		private ToolStripMenuItem mnuShowOne;
		private ToolStripMenuItem mnuShowAll;
		private ToolStripSeparator toolStripSeparator2;
		private DataGridViewTextBoxColumn GpID;
		private DataGridViewTextBoxColumn GroupName;
		private DataGridViewTextBoxColumn dg2;
		private DataGridViewTextBoxColumn Column1;
		private DataGridViewTextBoxColumn dg3;
		private DataGridViewTextBoxColumn dg4;
		private DataGridViewTextBoxColumn dg5;
		private DataGridViewTextBoxColumn dg6;
		private DataGridViewTextBoxColumn Column2;
		private DataGridViewTextBoxColumn Column3;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;
		private Label label3;
		private Func objFunc = new Func();
		public int ProductID = 0;
		private PrintDocument printDocument1;
		private int CurrIndex = -1;
		private int currGroup = 0;
		private products objP = new products();
		private bool loaded = false;
		public bool checkChange = false;
		public bool fastAdd = false;
		public string NameOfNewProduct = "";
		private DataTable objTable = new DataTable();
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(FrmupdtProduct));
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle5 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle6 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle7 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle8 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle9 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle10 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle11 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle12 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle13 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle14 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle15 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle16 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle17 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle18 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle19 = new DataGridViewCellStyle();
			this.printDocument1 = new PrintDocument();
			this.btnFastGroupProduct = new Button();
			this.btnAddNewUnit = new Button();
			this.cbbUnitProduct = new ComboBox();
			this.cbBCompany = new ComboBox();
			this.cbbParentGID = new ComboBox();
			this.label1 = new Label();
			this.txtMinimumNumber = new TextBox();
			this.txtRequestNumber = new TextBox();
			this.txtreTailPrice = new TextBox();
			this.label9 = new Label();
			this.txtSalePrice = new TextBox();
			this.label8 = new Label();
			this.txtInputPrice = new TextBox();
			this.label7 = new Label();
			this.txtName = new TextBox();
			this.label4 = new Label();
			this.tSBClose = new Button();
			this.tSBSave = new Button();
			this.tSBAdd = new Button();
			this.btnDel = new Button();
			this.dgvRep = new DataGridView();
			this.GpID = new DataGridViewTextBoxColumn();
			this.GroupName = new DataGridViewTextBoxColumn();
			this.dg2 = new DataGridViewTextBoxColumn();
			this.Column1 = new DataGridViewTextBoxColumn();
			this.dg3 = new DataGridViewTextBoxColumn();
			this.dg4 = new DataGridViewTextBoxColumn();
			this.dg5 = new DataGridViewTextBoxColumn();
			this.dg6 = new DataGridViewTextBoxColumn();
			this.Column2 = new DataGridViewTextBoxColumn();
			this.Column3 = new DataGridViewTextBoxColumn();
			this.contextMenuStrip1 = new ContextMenuStrip(this.components);
			this.mnuUsage = new ToolStripMenuItem();
			this.mnuIngredient = new ToolStripMenuItem();
			this.mnuUnit = new ToolStripMenuItem();
			this.toolStripSeparator1 = new ToolStripSeparator();
			this.mnuShowOne = new ToolStripMenuItem();
			this.mnuShowAll = new ToolStripMenuItem();
			this.toolStripSeparator2 = new ToolStripSeparator();
			this.mnuAdd = new ToolStripMenuItem();
			this.mnuDel = new ToolStripMenuItem();
			this.groupBox2 = new GroupBox();
			this.label18 = new Label();
			this.txtNumberWarning = new TextBox();
			this.label17 = new Label();
			this.label16 = new Label();
			this.txtDayNumberWarning = new TextBox();
			this.label13 = new Label();
			this.label12 = new Label();
			this.txtLiveDay = new TextBox();
			this.label10 = new Label();
			this.label15 = new Label();
			this.label14 = new Label();
			this.label11 = new Label();
			this.label5 = new Label();
			this.btnListUnit = new Button();
			this.btnPossAdd = new Button();
			this.lblPosition = new Label();
			this.cbbPosition = new ComboBox();
			this.ckbKipChildren = new CheckBox();
			this.ckbWarm = new CheckBox();
			this.ckbLight = new CheckBox();
			this.cbbSaveCondition = new ComboBox();
			this.cbbList = new ComboBox();
			this.txtSearch = new TextBox();
			this.label2 = new Label();
			this.btnShowAll = new Button();
			this.imageList1 = new ImageList(this.components);
			this.label6 = new Label();
			this.toolTip1 = new ToolTip(this.components);
			this.btnAddSave = new Button();
			this.label20 = new Label();
			this.txtBarcode = new TextBox();
			this.btnSetBarcode = new Button();
			this.bindingNavigator1 = new BindingNavigator(this.components);
			this.bindingNavigatorCountItem = new ToolStripLabel();
			this.bindingNavigatorMoveFirstItem = new ToolStripButton();
			this.bindingNavigatorMovePreviousItem = new ToolStripButton();
			this.bindingNavigatorSeparator = new ToolStripSeparator();
			this.bindingNavigatorPositionItem = new ToolStripTextBox();
			this.bindingNavigatorSeparator1 = new ToolStripSeparator();
			this.bindingNavigatorMoveNextItem = new ToolStripButton();
			this.bindingNavigatorMoveLastItem = new ToolStripButton();
			this.bindingNavigatorSeparator2 = new ToolStripSeparator();
			this.ckbSellWithBill = new CheckBox();
			this.ckbFocusMind = new CheckBox();
			this.lblSpace = new Label();
			this.dataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn2 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn3 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn4 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn5 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn6 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn7 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn8 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn9 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn10 = new DataGridViewTextBoxColumn();
			this.label3 = new Label();
			((ISupportInitialize)this.dgvRep).BeginInit();
			this.contextMenuStrip1.SuspendLayout();
			this.groupBox2.SuspendLayout();
			((ISupportInitialize)this.bindingNavigator1).BeginInit();
			this.bindingNavigator1.SuspendLayout();
			base.SuspendLayout();
			this.btnFastGroupProduct.Cursor = Cursors.Hand;
			this.btnFastGroupProduct.FlatAppearance.BorderSize = 0;
			this.btnFastGroupProduct.FlatStyle = FlatStyle.Flat;
//			this.btnFastGroupProduct.Image = (Image)componentResourceManager.GetObject("btnFastGroupProduct.Image");
			this.btnFastGroupProduct.Location = new Point(311, 23);
			this.btnFastGroupProduct.Name = "btnFastGroupProduct";
			this.btnFastGroupProduct.Size = new Size(16, 16);
			this.btnFastGroupProduct.TabIndex = 28;
			this.btnFastGroupProduct.TextAlign = ContentAlignment.MiddleRight;
			this.toolTip1.SetToolTip(this.btnFastGroupProduct, "Bổ sung phân nhóm hàng");
			this.btnFastGroupProduct.UseVisualStyleBackColor = true;
			this.btnFastGroupProduct.Click += new EventHandler(this.btnFastGroupProduct_Click);
			this.btnAddNewUnit.Cursor = Cursors.Hand;
			this.btnAddNewUnit.FlatAppearance.BorderSize = 0;
			this.btnAddNewUnit.FlatStyle = FlatStyle.Flat;
			//this.btnAddNewUnit.Image = (Image)componentResourceManager.GetObject("btnAddNewUnit.Image");
			this.btnAddNewUnit.Location = new Point(594, 24);
			this.btnAddNewUnit.Name = "btnAddNewUnit";
			this.btnAddNewUnit.Size = new Size(16, 16);
			this.btnAddNewUnit.TabIndex = 31;
			this.toolTip1.SetToolTip(this.btnAddNewUnit, "Bổ sung đơn vị tính");
			this.btnAddNewUnit.UseVisualStyleBackColor = true;
			this.btnAddNewUnit.Click += new EventHandler(this.btnAddNewUnit_Click);
			this.cbbUnitProduct.BackColor = Color.White;
			this.cbbUnitProduct.Cursor = Cursors.Hand;
			this.cbbUnitProduct.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbUnitProduct.FlatStyle = FlatStyle.Flat;
			this.cbbUnitProduct.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.cbbUnitProduct.FormattingEnabled = true;
			this.cbbUnitProduct.Location = new Point(463, 21);
			this.cbbUnitProduct.Name = "cbbUnitProduct";
			this.cbbUnitProduct.Size = new Size(105, 23);
			this.cbbUnitProduct.TabIndex = 11;
			this.cbbUnitProduct.Leave += new EventHandler(this.cbbUnitProduct_Leave);
			this.cbbUnitProduct.Enter += new EventHandler(this.cbbUnitProduct_Enter);
			this.cbbUnitProduct.KeyPress += new KeyPressEventHandler(this.cbbUnitProduct_KeyPress);
			this.cbBCompany.BackColor = Color.White;
			this.cbBCompany.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbBCompany.FlatStyle = FlatStyle.Flat;
			this.cbBCompany.FormattingEnabled = true;
			this.cbBCompany.Location = new Point(137, 76);
			this.cbBCompany.Name = "cbBCompany";
			this.cbBCompany.Size = new Size(210, 23);
			this.cbBCompany.TabIndex = 10;
			this.cbBCompany.Leave += new EventHandler(this.cbBCompany_Leave);
			this.cbBCompany.Enter += new EventHandler(this.cbBCompany_Enter);
			this.cbBCompany.KeyPress += new KeyPressEventHandler(this.cbBCompany_KeyPress);
			this.cbbParentGID.BackColor = Color.White;
			this.cbbParentGID.Cursor = Cursors.Hand;
			this.cbbParentGID.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbParentGID.FlatStyle = FlatStyle.Flat;
			this.cbbParentGID.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.cbbParentGID.FormattingEnabled = true;
			this.cbbParentGID.Location = new Point(137, 21);
			this.cbbParentGID.Name = "cbbParentGID";
			this.cbbParentGID.Size = new Size(210, 23);
			this.cbbParentGID.TabIndex = 8;
			this.cbbParentGID.Leave += new EventHandler(this.cbbParentGID_Leave);
			this.cbbParentGID.Enter += new EventHandler(this.cbbParentGID_Enter);
			this.cbbParentGID.KeyPress += new KeyPressEventHandler(this.cbbParentGID_KeyPress);
			this.label1.BackColor = Color.FromArgb(255, 255, 192);
			this.label1.BorderStyle = BorderStyle.Fixed3D;
			this.label1.Font = new Font("Arial", 9f);
			this.label1.Location = new Point(7, 22);
			this.label1.Name = "label1";
			this.label1.Size = new Size(126, 22);
			this.label1.TabIndex = 39;
			this.label1.Text = "Phân nhóm hàng :";
			this.label1.TextAlign = ContentAlignment.MiddleRight;
			this.txtMinimumNumber.BackColor = Color.White;
			this.txtMinimumNumber.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtMinimumNumber.Location = new Point(573, 48);
			this.txtMinimumNumber.Name = "txtMinimumNumber";
			this.txtMinimumNumber.Size = new Size(40, 22);
			this.txtMinimumNumber.TabIndex = 13;
			this.txtMinimumNumber.Text = "0";
			this.txtMinimumNumber.TextAlign = HorizontalAlignment.Right;
			this.txtMinimumNumber.Leave += new EventHandler(this.txtMinimumNumber_Leave_1);
			this.txtMinimumNumber.KeyPress += new KeyPressEventHandler(this.txtMinimumNumber_KeyPress_1);
			this.txtMinimumNumber.Enter += new EventHandler(this.txtMinimumNumber_Enter_1);
			this.txtRequestNumber.BackColor = Color.White;
			this.txtRequestNumber.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtRequestNumber.Location = new Point(463, 48);
			this.txtRequestNumber.Name = "txtRequestNumber";
			this.txtRequestNumber.Size = new Size(40, 22);
			this.txtRequestNumber.TabIndex = 12;
			this.txtRequestNumber.Text = "0";
			this.txtRequestNumber.TextAlign = HorizontalAlignment.Right;
			this.txtRequestNumber.Leave += new EventHandler(this.txtRequestNumber_Leave_1);
			this.txtRequestNumber.KeyPress += new KeyPressEventHandler(this.txtRequestNumber_KeyPress_1);
			this.txtRequestNumber.Enter += new EventHandler(this.txtRequestNumber_Enter_1);
			this.txtreTailPrice.BackColor = Color.White;
			this.txtreTailPrice.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtreTailPrice.Location = new Point(511, 317);
			this.txtreTailPrice.Name = "txtreTailPrice";
			this.txtreTailPrice.Size = new Size(96, 22);
			this.txtreTailPrice.TabIndex = 7;
			this.txtreTailPrice.Text = "0";
			this.txtreTailPrice.TextAlign = HorizontalAlignment.Right;
			this.txtreTailPrice.Leave += new EventHandler(this.txtreTailPrice_Leave);
			this.txtreTailPrice.KeyPress += new KeyPressEventHandler(this.txtreTailPrice_KeyPress);
			this.txtreTailPrice.Enter += new EventHandler(this.txtreTailPrice_Enter);
			this.label9.AutoSize = true;
			this.label9.Location = new Point(439, 320);
			this.label9.Name = "label9";
			this.label9.Size = new Size(69, 15);
			this.label9.TabIndex = 14;
			this.label9.Text = "Giá bán lẻ :";
			this.txtSalePrice.BackColor = Color.White;
			this.txtSalePrice.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtSalePrice.Location = new Point(300, 317);
			this.txtSalePrice.Name = "txtSalePrice";
			this.txtSalePrice.Size = new Size(96, 22);
			this.txtSalePrice.TabIndex = 6;
			this.txtSalePrice.Text = "0";
			this.txtSalePrice.TextAlign = HorizontalAlignment.Right;
			this.txtSalePrice.Leave += new EventHandler(this.txtSalePrice_Leave);
			this.txtSalePrice.KeyPress += new KeyPressEventHandler(this.txtSalePrice_KeyPress);
			this.txtSalePrice.Enter += new EventHandler(this.txtSalePrice_Enter);
			this.label8.AutoSize = true;
			this.label8.Location = new Point(210, 320);
			this.label8.Name = "label8";
			this.label8.Size = new Size(87, 15);
			this.label8.TabIndex = 12;
			this.label8.Text = "Giá bán buôn :";
			this.txtInputPrice.BackColor = Color.White;
			this.txtInputPrice.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtInputPrice.Location = new Point(284, 317);
			this.txtInputPrice.Name = "txtInputPrice";
			this.txtInputPrice.Size = new Size(108, 22);
			this.txtInputPrice.TabIndex = 5;
			this.txtInputPrice.Text = "0";
			this.txtInputPrice.TextAlign = HorizontalAlignment.Right;
			this.txtInputPrice.Leave += new EventHandler(this.txtInputPrice_Leave);
			this.txtInputPrice.KeyPress += new KeyPressEventHandler(this.txtInputPrice_KeyPress);
			this.txtInputPrice.Enter += new EventHandler(this.txtInputPrice_Enter);
			this.label7.AutoSize = true;
			this.label7.Location = new Point(218, 320);
			this.label7.Name = "label7";
			this.label7.Size = new Size(63, 15);
			this.label7.TabIndex = 10;
			this.label7.Text = "Giá nhập :";
			this.txtName.BackColor = Color.White;
			this.txtName.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtName.Location = new Point(137, 49);
			this.txtName.Name = "txtName";
			this.txtName.Size = new Size(210, 22);
			this.txtName.TabIndex = 9;
			this.txtName.Leave += new EventHandler(this.txtName_Leave);
			this.txtName.KeyPress += new KeyPressEventHandler(this.txtName_KeyPress);
			this.txtName.Enter += new EventHandler(this.txtName_Enter);
			this.label4.BackColor = Color.FromArgb(255, 255, 192);
			this.label4.BorderStyle = BorderStyle.Fixed3D;
			this.label4.Font = new Font("Arial", 9f);
			this.label4.Location = new Point(7, 49);
			this.label4.Name = "label4";
			this.label4.Size = new Size(126, 22);
			this.label4.TabIndex = 4;
			this.label4.Text = "Tên hàng hoá :";
			this.label4.TextAlign = ContentAlignment.MiddleRight;
			this.tSBClose.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.tSBClose.BackColor = SystemColors.ControlLight;
			this.tSBClose.Cursor = Cursors.Hand;
			this.tSBClose.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.tSBClose.FlatStyle = FlatStyle.Flat;
			this.tSBClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.tSBClose.ImageAlign = ContentAlignment.MiddleLeft;
//			this.tSBClose.ImeMode = ImeMode.NoControl;
			this.tSBClose.Location = new Point(790, 565);
			this.tSBClose.Name = "tSBClose";
			this.tSBClose.Size = new Size(100, 30);
			this.tSBClose.TabIndex = 27;
			this.tSBClose.Text = "Thoát  [ ESC ]";
			this.tSBClose.UseVisualStyleBackColor = false;
			this.tSBClose.Click += new EventHandler(this.tSBClose_Click);
			this.tSBSave.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.tSBSave.BackColor = SystemColors.ControlLight;
			this.tSBSave.Cursor = Cursors.Hand;
			this.tSBSave.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.tSBSave.FlatStyle = FlatStyle.Flat;
			this.tSBSave.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.tSBSave.ImageAlign = ContentAlignment.MiddleLeft;
//			this.tSBSave.ImeMode = ImeMode.NoControl;
			this.tSBSave.Location = new Point(118, 565);
			this.tSBSave.Name = "tSBSave";
			this.tSBSave.Size = new Size(105, 30);
			this.tSBSave.TabIndex = 25;
			this.tSBSave.Text = "Ghi nhận [ F6 ]";
			this.tSBSave.UseVisualStyleBackColor = false;
			this.tSBSave.Click += new EventHandler(this.tSBSave_Click);
			this.tSBSave.KeyPress += new KeyPressEventHandler(this.tSBSave_KeyPress);
			this.tSBAdd.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.tSBAdd.BackColor = SystemColors.ControlLight;
			this.tSBAdd.Cursor = Cursors.Hand;
			this.tSBAdd.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.tSBAdd.FlatStyle = FlatStyle.Flat;
			this.tSBAdd.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.tSBAdd.ImageAlign = ContentAlignment.MiddleLeft;
			//this.tSBAdd.ImeMode = ImeMode.NoControl;
			this.tSBAdd.Location = new Point(9, 565);
			this.tSBAdd.Name = "tSBAdd";
			this.tSBAdd.Size = new Size(105, 30);
			this.tSBAdd.TabIndex = 24;
			this.tSBAdd.Text = "Thêm mới [ F4 ]";
			this.tSBAdd.UseVisualStyleBackColor = false;
			this.tSBAdd.Click += new EventHandler(this.tSBAdd_Click);
			this.btnDel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnDel.BackColor = SystemColors.ControlLight;
			this.btnDel.Cursor = Cursors.Hand;
			this.btnDel.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.btnDel.FlatStyle = FlatStyle.Flat;
			this.btnDel.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnDel.ImageAlign = ContentAlignment.MiddleLeft;
			this.btnDel.Location = new Point(227, 565);
			this.btnDel.Name = "btnDel";
			this.btnDel.Size = new Size(105, 30);
			this.btnDel.TabIndex = 26;
			this.btnDel.Text = "Xoá bỏ [ F8 ]";
			this.btnDel.UseVisualStyleBackColor = false;
			this.btnDel.Click += new EventHandler(this.btnDel_Click);
			this.dgvRep.AllowUserToAddRows = false;
			this.dgvRep.AllowUserToDeleteRows = false;
			this.dgvRep.AllowUserToResizeColumns = false;
			this.dgvRep.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.White;
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.dgvRep.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvRep.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvRep.BackgroundColor = Color.White;
			this.dgvRep.BorderStyle = BorderStyle.Fixed3D;
			this.dgvRep.ColumnHeadersHeight = 24;
			this.dgvRep.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvRep.Columns.AddRange(new DataGridViewColumn[]
			{
				this.GpID,
				this.GroupName,
				this.dg2,
				this.Column1,
				this.dg3,
				this.dg4,
				this.dg5,
				this.dg6,
				this.Column2,
				this.Column3
			});
			this.dgvRep.ContextMenuStrip = this.contextMenuStrip1;
			this.dgvRep.Cursor = Cursors.Hand;
			this.dgvRep.EnableHeadersVisualStyles = false;
			this.dgvRep.Location = new Point(5, 46);
			this.dgvRep.Name = "dgvRep";
			this.dgvRep.ReadOnly = true;
			this.dgvRep.RowHeadersVisible = false;
			this.dgvRep.RowHeadersWidth = 26;
			this.dgvRep.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			dataGridViewCellStyle2.BackColor = Color.White;
			dataGridViewCellStyle2.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvRep.RowsDefaultCellStyle = dataGridViewCellStyle2;
			this.dgvRep.RowTemplate.DefaultCellStyle.BackColor = Color.White;
			this.dgvRep.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.dgvRep.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
			this.dgvRep.Size = new Size(889, 324);
			this.dgvRep.TabIndex = 6;
			this.dgvRep.RowPrePaint += new DataGridViewRowPrePaintEventHandler(this.dgvRep_RowPrePaint);
			this.dgvRep.CellEnter += new DataGridViewCellEventHandler(this.dgvRep_CellEnter);
			this.GpID.DataPropertyName = "GpID";
			this.GpID.HeaderText = "Column4";
			this.GpID.Name = "GpID";
			this.GpID.ReadOnly = true;
			this.GpID.Visible = false;
			this.GroupName.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.GroupName.DataPropertyName = "GroupName";
			dataGridViewCellStyle3.NullValue = "False";
			this.GroupName.DefaultCellStyle = dataGridViewCellStyle3;
			this.GroupName.HeaderText = "Nhóm sản phẩm";
			this.GroupName.MinimumWidth = 200;
			this.GroupName.Name = "GroupName";
			this.GroupName.ReadOnly = true;
			this.GroupName.Resizable = DataGridViewTriState.False;
			this.GroupName.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.GroupName.Width = 200;
			this.dg2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dg2.DataPropertyName = "P_Name";
			dataGridViewCellStyle4.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle4.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle4.NullValue = null;
			this.dg2.DefaultCellStyle = dataGridViewCellStyle4;
			this.dg2.HeaderText = "Tên sản phẩm";
			this.dg2.MinimumWidth = 120;
			this.dg2.Name = "dg2";
			this.dg2.ReadOnly = true;
			this.Column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column1.DataPropertyName = "UnitName";
			this.Column1.HeaderText = "Đơn vị tính";
			this.Column1.MinimumWidth = 100;
			this.Column1.Name = "Column1";
			this.Column1.ReadOnly = true;
			this.dg3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dg3.DataPropertyName = "P_PriceBase";
			dataGridViewCellStyle5.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle5.Format = "###,0";
			this.dg3.DefaultCellStyle = dataGridViewCellStyle5;
			this.dg3.HeaderText = "Giá nhập";
			this.dg3.MinimumWidth = 90;
			this.dg3.Name = "dg3";
			this.dg3.ReadOnly = true;
			this.dg3.Width = 90;
			this.dg4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dg4.DataPropertyName = "P_PriceTrade";
			dataGridViewCellStyle6.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle6.Format = "###,0";
			dataGridViewCellStyle6.NullValue = null;
			this.dg4.DefaultCellStyle = dataGridViewCellStyle6;
			this.dg4.HeaderText = "Giá bán buôn";
			this.dg4.MinimumWidth = 90;
			this.dg4.Name = "dg4";
			this.dg4.ReadOnly = true;
			this.dg4.Width = 90;
			this.dg5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dg5.DataPropertyName = "P_PriceRetail";
			dataGridViewCellStyle7.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle7.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle7.Format = "###,0";
			this.dg5.DefaultCellStyle = dataGridViewCellStyle7;
			this.dg5.HeaderText = "Giá bán lẻ";
			this.dg5.MinimumWidth = 90;
			this.dg5.Name = "dg5";
			this.dg5.ReadOnly = true;
			this.dg5.Width = 90;
			this.dg6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dg6.DataPropertyName = "PID";
			this.dg6.HeaderText = "PID";
			this.dg6.Name = "dg6";
			this.dg6.ReadOnly = true;
			this.dg6.Resizable = DataGridViewTriState.False;
			this.dg6.Visible = false;
			this.dg6.Width = 5;
			this.Column2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column2.DataPropertyName = "MinBalance";
			dataGridViewCellStyle8.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle8.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle8.ForeColor = Color.Blue;
			this.Column2.DefaultCellStyle = dataGridViewCellStyle8;
			this.Column2.HeaderText = "Tồn tối thiểu";
			this.Column2.MinimumWidth = 90;
			this.Column2.Name = "Column2";
			this.Column2.ReadOnly = true;
			this.Column2.Width = 90;
			this.Column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column3.DataPropertyName = "MaxBalance";
			dataGridViewCellStyle9.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle9.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle9.ForeColor = Color.Red;
			this.Column3.DefaultCellStyle = dataGridViewCellStyle9;
			this.Column3.HeaderText = "Tồn tối đa";
			this.Column3.MinimumWidth = 90;
			this.Column3.Name = "Column3";
			this.Column3.ReadOnly = true;
			this.Column3.Width = 90;
			this.contextMenuStrip1.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.contextMenuStrip1.Items.AddRange(new ToolStripItem[]
			{
				this.mnuUsage,
				this.mnuIngredient,
				this.mnuUnit,
				this.toolStripSeparator1,
				this.mnuShowOne,
				this.mnuShowAll,
				this.toolStripSeparator2,
				this.mnuAdd,
				this.mnuDel
			});
			this.contextMenuStrip1.Name = "contextMenuStrip1";
			this.contextMenuStrip1.Size = new Size(226, 170);
			this.mnuUsage.Name = "mnuUsage";
			this.mnuUsage.Size = new Size(225, 22);
			this.mnuUsage.Text = "Công dụng của thuốc";
			this.mnuUsage.Click += new EventHandler(this.mnuUsage_Click);
			this.mnuIngredient.Name = "mnuIngredient";
			this.mnuIngredient.Size = new Size(225, 22);
			this.mnuIngredient.Text = "Hoạt chất của thuốc";
			this.mnuIngredient.Click += new EventHandler(this.mnuIngredient_Click);
			this.mnuUnit.Name = "mnuUnit";
			this.mnuUnit.Size = new Size(225, 22);
			this.mnuUnit.Text = "Hệ thống đơn vị tính";
			this.mnuUnit.Click += new EventHandler(this.mnuUnit_Click);
			this.toolStripSeparator1.Name = "toolStripSeparator1";
			this.toolStripSeparator1.Size = new Size(222, 6);
			this.mnuShowOne.Name = "mnuShowOne";
			this.mnuShowOne.Size = new Size(225, 22);
			this.mnuShowOne.Text = "Chỉ xem nhóm hiện tại";
			this.mnuShowOne.Click += new EventHandler(this.mnuShowOne_Click);
			this.mnuShowAll.Name = "mnuShowAll";
			this.mnuShowAll.Size = new Size(225, 22);
			this.mnuShowAll.Text = "Xem tất cả nhóm sản phẩm";
			this.mnuShowAll.Click += new EventHandler(this.mnuShowAll_Click);
			this.toolStripSeparator2.Name = "toolStripSeparator2";
			this.toolStripSeparator2.Size = new Size(222, 6);
			this.mnuAdd.Name = "mnuAdd";
			this.mnuAdd.Size = new Size(225, 22);
			this.mnuAdd.Text = "Thêm mới";
			this.mnuAdd.Click += new EventHandler(this.mnuAdd_Click);
			this.mnuDel.Name = "mnuDel";
			this.mnuDel.Size = new Size(225, 22);
			this.mnuDel.Text = "Xóa bỏ thuốc";
			this.mnuDel.Click += new EventHandler(this.mnuDel_Click);
			this.groupBox2.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.groupBox2.Controls.Add(this.label18);
			this.groupBox2.Controls.Add(this.txtNumberWarning);
			this.groupBox2.Controls.Add(this.label17);
			this.groupBox2.Controls.Add(this.label16);
			this.groupBox2.Controls.Add(this.txtDayNumberWarning);
			this.groupBox2.Controls.Add(this.label13);
			this.groupBox2.Controls.Add(this.label12);
			this.groupBox2.Controls.Add(this.txtLiveDay);
			this.groupBox2.Controls.Add(this.label10);
			this.groupBox2.Controls.Add(this.label15);
			this.groupBox2.Controls.Add(this.label14);
			this.groupBox2.Controls.Add(this.label11);
			this.groupBox2.Controls.Add(this.label5);
			this.groupBox2.Controls.Add(this.btnListUnit);
			this.groupBox2.Controls.Add(this.btnPossAdd);
			this.groupBox2.Controls.Add(this.lblPosition);
			this.groupBox2.Controls.Add(this.cbbPosition);
			this.groupBox2.Controls.Add(this.txtRequestNumber);
			this.groupBox2.Controls.Add(this.btnFastGroupProduct);
			this.groupBox2.Controls.Add(this.btnAddNewUnit);
			this.groupBox2.Controls.Add(this.txtMinimumNumber);
			this.groupBox2.Controls.Add(this.cbbUnitProduct);
			this.groupBox2.Controls.Add(this.cbBCompany);
			this.groupBox2.Controls.Add(this.label1);
			this.groupBox2.Controls.Add(this.txtName);
			this.groupBox2.Controls.Add(this.label4);
			this.groupBox2.Controls.Add(this.cbbParentGID);
			this.groupBox2.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.groupBox2.Location = new Point(5, 405);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new Size(889, 109);
			this.groupBox2.TabIndex = 7;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "Thông tin chính";
			this.label18.AutoSize = true;
			this.label18.BackColor = SystemColors.Control;
			this.label18.Font = new Font("Arial", 9f);
			this.label18.Location = new Point(833, 79);
			this.label18.Name = "label18";
			this.label18.Size = new Size(42, 15);
			this.label18.TabIndex = 141;
			this.label18.Text = "[ ĐVT ]";
			this.label18.TextAlign = ContentAlignment.MiddleRight;
			this.txtNumberWarning.BackColor = Color.White;
			this.txtNumberWarning.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtNumberWarning.Location = new Point(752, 76);
			this.txtNumberWarning.Name = "txtNumberWarning";
			this.txtNumberWarning.Size = new Size(75, 22);
			this.txtNumberWarning.TabIndex = 17;
			this.txtNumberWarning.Text = "0";
			this.txtNumberWarning.TextAlign = HorizontalAlignment.Right;
			this.label17.BackColor = Color.FromArgb(255, 255, 192);
			this.label17.BorderStyle = BorderStyle.Fixed3D;
			this.label17.Font = new Font("Arial", 9f);
			this.label17.Location = new Point(621, 76);
			this.label17.Name = "label17";
			this.label17.Size = new Size(125, 21);
			this.label17.TabIndex = 139;
			this.label17.Text = "Số lượng cảnh báo :";
			this.label17.TextAlign = ContentAlignment.MiddleRight;
			this.label16.AutoSize = true;
			this.label16.BackColor = SystemColors.Control;
			this.label16.Font = new Font("Arial", 9f);
			this.label16.Location = new Point(833, 51);
			this.label16.Name = "label16";
			this.label16.Size = new Size(47, 15);
			this.label16.TabIndex = 138;
			this.label16.Text = "[ Ngày ]";
			this.label16.TextAlign = ContentAlignment.MiddleRight;
			this.txtDayNumberWarning.BackColor = Color.White;
			this.txtDayNumberWarning.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtDayNumberWarning.Location = new Point(752, 49);
			this.txtDayNumberWarning.Name = "txtDayNumberWarning";
			this.txtDayNumberWarning.Size = new Size(75, 22);
			this.txtDayNumberWarning.TabIndex = 16;
			this.txtDayNumberWarning.Text = "0";
			this.txtDayNumberWarning.TextAlign = HorizontalAlignment.Right;
			this.label13.BackColor = Color.FromArgb(255, 255, 192);
			this.label13.BorderStyle = BorderStyle.Fixed3D;
			this.label13.Font = new Font("Arial", 9f);
			this.label13.Location = new Point(621, 49);
			this.label13.Name = "label13";
			this.label13.Size = new Size(125, 21);
			this.label13.TabIndex = 136;
			this.label13.Text = "Số ngày cảnh báo :";
			this.label13.TextAlign = ContentAlignment.MiddleRight;
			this.label12.AutoSize = true;
			this.label12.BackColor = SystemColors.Control;
			this.label12.Font = new Font("Arial", 9f);
			this.label12.Location = new Point(507, 79);
			this.label12.Name = "label12";
			this.label12.Size = new Size(47, 15);
			this.label12.TabIndex = 135;
			this.label12.Text = "[ Ngày ]";
			this.label12.TextAlign = ContentAlignment.MiddleRight;
			this.txtLiveDay.BackColor = Color.White;
			this.txtLiveDay.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtLiveDay.Location = new Point(463, 76);
			this.txtLiveDay.Name = "txtLiveDay";
			this.txtLiveDay.Size = new Size(40, 22);
			this.txtLiveDay.TabIndex = 14;
			this.txtLiveDay.Text = "0";
			this.txtLiveDay.TextAlign = HorizontalAlignment.Right;
			this.label10.BackColor = Color.FromArgb(255, 255, 192);
			this.label10.BorderStyle = BorderStyle.Fixed3D;
			this.label10.Font = new Font("Arial", 9f);
			this.label10.Location = new Point(357, 76);
			this.label10.Name = "label10";
			this.label10.Size = new Size(100, 21);
			this.label10.TabIndex = 133;
			this.label10.Text = "Đời sống thuốc :";
			this.label10.TextAlign = ContentAlignment.MiddleRight;
			this.label15.BackColor = Color.FromArgb(255, 255, 192);
			this.label15.BorderStyle = BorderStyle.Fixed3D;
			this.label15.Font = new Font("Arial", 9f);
			this.label15.Location = new Point(357, 49);
			this.label15.Name = "label15";
			this.label15.Size = new Size(100, 21);
			this.label15.TabIndex = 132;
			this.label15.Text = "Tồn tối đa:";
			this.label15.TextAlign = ContentAlignment.MiddleRight;
			this.label14.BackColor = Color.FromArgb(255, 255, 192);
			this.label14.BorderStyle = BorderStyle.Fixed3D;
			this.label14.Font = new Font("Arial", 9f);
			this.label14.Location = new Point(508, 49);
			this.label14.Name = "label14";
			this.label14.Size = new Size(62, 21);
			this.label14.TabIndex = 131;
			this.label14.Text = "Tối thiểu :";
			this.label14.TextAlign = ContentAlignment.MiddleRight;
			this.label11.BackColor = Color.FromArgb(255, 255, 192);
			this.label11.BorderStyle = BorderStyle.Fixed3D;
			this.label11.Font = new Font("Arial", 9f);
			this.label11.Location = new Point(357, 22);
			this.label11.Name = "label11";
			this.label11.Size = new Size(100, 21);
			this.label11.TabIndex = 130;
			this.label11.Text = "Đơn vị tính :";
			this.label11.TextAlign = ContentAlignment.MiddleRight;
			this.label5.BackColor = Color.FromArgb(255, 255, 192);
			this.label5.BorderStyle = BorderStyle.Fixed3D;
			this.label5.Font = new Font("Arial", 9f);
			this.label5.Location = new Point(7, 76);
			this.label5.Name = "label5";
			this.label5.Size = new Size(126, 22);
			this.label5.TabIndex = 129;
			this.label5.Text = "Nhà sản xuất :";
			this.label5.TextAlign = ContentAlignment.MiddleRight;
			this.btnListUnit.Cursor = Cursors.Hand;
			this.btnListUnit.FlatAppearance.BorderSize = 0;
			this.btnListUnit.FlatStyle = FlatStyle.Flat;
//			this.btnListUnit.Image = (Image)componentResourceManager.GetObject("btnListUnit.Image");
			this.btnListUnit.Location = new Point(572, 22);
			this.btnListUnit.Name = "btnListUnit";
			this.btnListUnit.Size = new Size(18, 18);
			this.btnListUnit.TabIndex = 30;
			this.toolTip1.SetToolTip(this.btnListUnit, "Quy định hệ thống đơn\r\nvị tính con và hệ số quy đổi");
			this.btnListUnit.UseVisualStyleBackColor = true;
			this.btnListUnit.Click += new EventHandler(this.btnListUnit_Click);
			this.btnPossAdd.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.btnPossAdd.Cursor = Cursors.Hand;
			this.btnPossAdd.FlatAppearance.BorderSize = 0;
			this.btnPossAdd.FlatStyle = FlatStyle.Flat;
//			this.btnPossAdd.Image = (Image)componentResourceManager.GetObject("btnPossAdd.Image");
			this.btnPossAdd.Location = new Point(843, 24);
			this.btnPossAdd.Name = "btnPossAdd";
			this.btnPossAdd.Size = new Size(16, 16);
			this.btnPossAdd.TabIndex = 32;
			this.toolTip1.SetToolTip(this.btnPossAdd, "Bổ sung vị trí cất giữ thuốc");
			this.btnPossAdd.UseVisualStyleBackColor = true;
			this.btnPossAdd.Click += new EventHandler(this.btnPossAdd_Click);
			this.lblPosition.BackColor = Color.FromArgb(255, 255, 192);
			this.lblPosition.BorderStyle = BorderStyle.Fixed3D;
			this.lblPosition.Font = new Font("Arial", 9f);
			this.lblPosition.Location = new Point(621, 22);
			this.lblPosition.Name = "lblPosition";
			this.lblPosition.Size = new Size(126, 21);
			this.lblPosition.TabIndex = 126;
			this.lblPosition.Text = "Vị trí cất giữ :";
			this.lblPosition.TextAlign = ContentAlignment.MiddleRight;
			this.cbbPosition.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.cbbPosition.BackColor = Color.White;
			this.cbbPosition.Cursor = Cursors.Hand;
			this.cbbPosition.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbPosition.FlatStyle = FlatStyle.Flat;
			this.cbbPosition.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.cbbPosition.FormattingEnabled = true;
			this.cbbPosition.Location = new Point(752, 21);
			this.cbbPosition.Name = "cbbPosition";
			this.cbbPosition.Size = new Size(128, 23);
			this.cbbPosition.TabIndex = 15;
			this.ckbKipChildren.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.ckbKipChildren.AutoSize = true;
			this.ckbKipChildren.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.ckbKipChildren.Location = new Point(531, 516);
			this.ckbKipChildren.Name = "ckbKipChildren";
			this.ckbKipChildren.Size = new Size(144, 19);
			this.ckbKipChildren.TabIndex = 20;
			this.ckbKipChildren.Text = "Để xa tầm tay trẻ em";
			this.ckbKipChildren.UseVisualStyleBackColor = true;
			this.ckbWarm.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.ckbWarm.AutoSize = true;
			this.ckbWarm.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.ckbWarm.Location = new Point(681, 516);
			this.ckbWarm.Name = "ckbWarm";
			this.ckbWarm.Size = new Size(104, 19);
			this.ckbWarm.TabIndex = 21;
			this.ckbWarm.Text = "Tránh ẩm ướt";
			this.ckbWarm.UseVisualStyleBackColor = true;
			this.ckbLight.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.ckbLight.AutoSize = true;
			this.ckbLight.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.ckbLight.Location = new Point(363, 516);
			this.ckbLight.Name = "ckbLight";
			this.ckbLight.Size = new Size(162, 19);
			this.ckbLight.TabIndex = 19;
			this.ckbLight.Text = "Tránh ánh sáng mặt trời";
			this.ckbLight.UseVisualStyleBackColor = true;
			this.cbbSaveCondition.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.cbbSaveCondition.BackColor = Color.White;
			this.cbbSaveCondition.Cursor = Cursors.Hand;
			this.cbbSaveCondition.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbSaveCondition.FlatStyle = FlatStyle.Flat;
			this.cbbSaveCondition.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
			this.cbbSaveCondition.FormattingEnabled = true;
			this.cbbSaveCondition.Location = new Point(142, 523);
			this.cbbSaveCondition.Name = "cbbSaveCondition";
			this.cbbSaveCondition.Size = new Size(210, 23);
			this.cbbSaveCondition.TabIndex = 18;
			this.cbbList.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbList.Font = new Font("Arial", 12.75f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.cbbList.FormattingEnabled = true;
			this.cbbList.Items.AddRange(new object[]
			{
				"TẨT CẢ",
				"------ A",
				"------ B",
				"------ C",
				"------ D",
				"------ E",
				"------ F",
				"------ G",
				"------ H",
				"------ I",
				"------ J",
				"------ K",
				"------ L",
				"------ M",
				"------ N",
				"------ O",
				"------ P",
				"------ Q",
				"------ R",
				"------ S",
				"------ T",
				"------ U",
				"------ V",
				"------ W",
				"------ X",
				"------ Y",
				"------ Z"
			});
			this.cbbList.Location = new Point(5, 11);
			this.cbbList.Name = "cbbList";
			this.cbbList.Size = new Size(102, 27);
			this.cbbList.TabIndex = 0;
			this.cbbList.SelectedIndexChanged += new EventHandler(this.cbbList_SelectedIndexChanged);
			this.txtSearch.AcceptsReturn = true;
			this.txtSearch.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtSearch.Font = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtSearch.Location = new Point(349, 13);
			this.txtSearch.Name = "txtSearch";
			this.txtSearch.Size = new Size(184, 25);
			this.txtSearch.TabIndex = 2;
			this.txtSearch.TextChanged += new EventHandler(this.txtSearch_TextChanged);
			this.txtSearch.Enter += new EventHandler(this.txtSearch_Enter);
			this.label2.AutoSize = true;
			this.label2.BackColor = Color.White;
			this.label2.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label2.Location = new Point(203, 18);
			this.label2.Name = "label2";
			this.label2.Size = new Size(142, 15);
			this.label2.TabIndex = 127;
			this.label2.Text = "Tìm theo tên sản phẩm :";
			this.label2.TextAlign = ContentAlignment.MiddleRight;
			this.btnShowAll.BackColor = SystemColors.ButtonFace;
			this.btnShowAll.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.btnShowAll.FlatStyle = FlatStyle.Flat;
			this.btnShowAll.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnShowAll.Location = new Point(111, 12);
			this.btnShowAll.Name = "btnShowAll";
			this.btnShowAll.Size = new Size(83, 26);
			this.btnShowAll.TabIndex = 1;
			this.btnShowAll.Text = "Xem tất cả";
			this.btnShowAll.UseVisualStyleBackColor = false;
			this.btnShowAll.Click += new EventHandler(this.btnShowAll_Click);
//			this.imageList1.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("imageList1.ImageStream");
			this.imageList1.TransparentColor = Color.Transparent;
			this.imageList1.Images.SetKeyName(0, "star_2.png");
			this.imageList1.Images.SetKeyName(1, "31.png");
			this.label6.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.label6.BackColor = Color.FromArgb(255, 255, 192);
			this.label6.BorderStyle = BorderStyle.Fixed3D;
			this.label6.Location = new Point(5, 524);
			this.label6.Name = "label6";
			this.label6.Size = new Size(133, 21);
			this.label6.TabIndex = 131;
			this.label6.Text = "Điều kiện bảo quản :";
			this.label6.TextAlign = ContentAlignment.MiddleRight;
			this.toolTip1.IsBalloon = true;
			this.btnAddSave.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnAddSave.Cursor = Cursors.Hand;
			this.btnAddSave.FlatAppearance.BorderSize = 0;
			this.btnAddSave.FlatStyle = FlatStyle.Flat;
//			this.btnAddSave.Image = (Image)componentResourceManager.GetObject("btnAddSave.Image");
			this.btnAddSave.Location = new Point(316, 526);
			this.btnAddSave.Name = "btnAddSave";
			this.btnAddSave.Size = new Size(16, 16);
			this.btnAddSave.TabIndex = 29;
			this.btnAddSave.TextAlign = ContentAlignment.MiddleRight;
			this.toolTip1.SetToolTip(this.btnAddSave, "Thêm mới điều kiện bảo quản");
			this.btnAddSave.UseVisualStyleBackColor = true;
			this.btnAddSave.Click += new EventHandler(this.btnAddSave_Click);
			this.label20.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.label20.AutoSize = true;
			this.label20.BackColor = Color.White;
			this.label20.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label20.Location = new Point(554, 19);
			this.label20.Name = "label20";
			this.label20.Size = new Size(60, 15);
			this.label20.TabIndex = 135;
			this.label20.Text = "Mã vạch :";
			this.label20.TextAlign = ContentAlignment.MiddleRight;
			this.txtBarcode.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.txtBarcode.BackColor = Color.FromArgb(255, 255, 192);
			this.txtBarcode.Font = new Font("Arial", 12f, FontStyle.Bold);
			this.txtBarcode.Location = new Point(618, 13);
			this.txtBarcode.Name = "txtBarcode";
			this.txtBarcode.Size = new Size(167, 26);
			this.txtBarcode.TabIndex = 3;
			this.txtBarcode.KeyDown += new KeyEventHandler(this.txtBarcode_KeyDown);
			this.btnSetBarcode.Anchor = (AnchorStyles.Top | AnchorStyles.Right);
			this.btnSetBarcode.BackColor = SystemColors.ButtonFace;
			this.btnSetBarcode.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.btnSetBarcode.FlatStyle = FlatStyle.Flat;
			this.btnSetBarcode.Location = new Point(790, 12);
			this.btnSetBarcode.Name = "btnSetBarcode";
			this.btnSetBarcode.Size = new Size(104, 27);
			this.btnSetBarcode.TabIndex = 4;
			this.btnSetBarcode.Text = "Gán mã vạch";
			this.btnSetBarcode.UseVisualStyleBackColor = false;
			this.btnSetBarcode.Click += new EventHandler(this.btnSetBarcode_Click);
			this.bindingNavigator1.AddNewItem = null;
			this.bindingNavigator1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.bindingNavigator1.AutoSize = false;
			this.bindingNavigator1.BackColor = SystemColors.ButtonFace;
			this.bindingNavigator1.CountItem = this.bindingNavigatorCountItem;
			this.bindingNavigator1.CountItemFormat = "/ {0}";
			this.bindingNavigator1.DeleteItem = null;
			this.bindingNavigator1.Dock = DockStyle.None;
			this.bindingNavigator1.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.bindingNavigator1.GripStyle = ToolStripGripStyle.Hidden;
			this.bindingNavigator1.Items.AddRange(new ToolStripItem[]
			{
				this.bindingNavigatorMoveFirstItem,
				this.bindingNavigatorMovePreviousItem,
				this.bindingNavigatorSeparator,
				this.bindingNavigatorPositionItem,
				this.bindingNavigatorCountItem,
				this.bindingNavigatorSeparator1,
				this.bindingNavigatorMoveNextItem,
				this.bindingNavigatorMoveLastItem,
				this.bindingNavigatorSeparator2
			});
			this.bindingNavigator1.Location = new Point(5, 374);
			this.bindingNavigator1.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
			this.bindingNavigator1.MoveLastItem = this.bindingNavigatorMoveLastItem;
			this.bindingNavigator1.MoveNextItem = this.bindingNavigatorMoveNextItem;
			this.bindingNavigator1.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
			this.bindingNavigator1.Name = "bindingNavigator1";
			this.bindingNavigator1.PositionItem = this.bindingNavigatorPositionItem;
			this.bindingNavigator1.RenderMode = ToolStripRenderMode.Professional;
			this.bindingNavigator1.Size = new Size(889, 25);
			this.bindingNavigator1.TabIndex = 777;
			this.bindingNavigator1.Text = "bindingNavigator1";
			this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
			this.bindingNavigatorCountItem.Size = new Size(28, 22);
			this.bindingNavigatorCountItem.Text = "/ {0}";
			this.bindingNavigatorCountItem.ToolTipText = "Total number of items";
			this.bindingNavigatorMoveFirstItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
			//this.bindingNavigatorMoveFirstItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveFirstItem.Image");
			this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
			this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveFirstItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveFirstItem.Text = "Move first";
			this.bindingNavigatorMovePreviousItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
			//this.bindingNavigatorMovePreviousItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMovePreviousItem.Image");
			this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
			this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMovePreviousItem.Size = new Size(23, 22);
			this.bindingNavigatorMovePreviousItem.Text = "Move previous";
			this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
			this.bindingNavigatorSeparator.Size = new Size(6, 25);
			this.bindingNavigatorPositionItem.AccessibleName = "Position";
			this.bindingNavigatorPositionItem.AutoSize = false;
			this.bindingNavigatorPositionItem.BackColor = SystemColors.ButtonFace;
			this.bindingNavigatorPositionItem.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
			this.bindingNavigatorPositionItem.Size = new Size(50, 21);
			this.bindingNavigatorPositionItem.Text = "0";
			this.bindingNavigatorPositionItem.TextBoxTextAlign = HorizontalAlignment.Center;
			this.bindingNavigatorPositionItem.ToolTipText = "Current position";
			this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator1";
			this.bindingNavigatorSeparator1.Size = new Size(6, 25);
			this.bindingNavigatorMoveNextItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
			//this.bindingNavigatorMoveNextItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveNextItem.Image");
			this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
			this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveNextItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveNextItem.Text = "Move next";
			this.bindingNavigatorMoveLastItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
			//this.bindingNavigatorMoveLastItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveLastItem.Image");
			this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
			this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveLastItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveLastItem.Text = "Move last";
			this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator2";
			this.bindingNavigatorSeparator2.Size = new Size(6, 25);
			this.ckbSellWithBill.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.ckbSellWithBill.AutoSize = true;
			this.ckbSellWithBill.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.ckbSellWithBill.Location = new Point(363, 541);
			this.ckbSellWithBill.Name = "ckbSellWithBill";
			this.ckbSellWithBill.Size = new Size(102, 19);
			this.ckbSellWithBill.TabIndex = 779;
			this.ckbSellWithBill.Text = "Bán theo đơn";
			this.ckbSellWithBill.UseVisualStyleBackColor = true;
			this.ckbFocusMind.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.ckbFocusMind.AutoSize = true;
			this.ckbFocusMind.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.ckbFocusMind.Location = new Point(531, 541);
			this.ckbFocusMind.Name = "ckbFocusMind";
			this.ckbFocusMind.Size = new Size(131, 19);
			this.ckbFocusMind.TabIndex = 780;
			this.ckbFocusMind.Text = "Thuốc hướng thần";
			this.ckbFocusMind.UseVisualStyleBackColor = true;
			this.lblSpace.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.lblSpace.BackColor = Color.White;
			this.lblSpace.Location = new Point(5, 561);
			this.lblSpace.Name = "lblSpace";
			this.lblSpace.Size = new Size(889, 38);
			this.lblSpace.TabIndex = 781;
			this.dataGridViewTextBoxColumn1.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewTextBoxColumn1.DataPropertyName = "P_Name";
			dataGridViewCellStyle10.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle10.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle10.NullValue = null;
			this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle10;
			this.dataGridViewTextBoxColumn1.HeaderText = "Tên sản phẩm";
			this.dataGridViewTextBoxColumn1.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
			this.dataGridViewTextBoxColumn1.ReadOnly = true;
			this.dataGridViewTextBoxColumn1.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn1.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn1.Visible = false;
			this.dataGridViewTextBoxColumn2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn2.DataPropertyName = "UnitName";
			dataGridViewCellStyle11.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle11.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle11.NullValue = null;
			this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle11;
			this.dataGridViewTextBoxColumn2.HeaderText = "Đơn vị tính";
			this.dataGridViewTextBoxColumn2.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
			this.dataGridViewTextBoxColumn2.ReadOnly = true;
			this.dataGridViewTextBoxColumn2.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn2.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn2.Width = 120;
			this.dataGridViewTextBoxColumn3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn3.DataPropertyName = "P_PriceBase";
			dataGridViewCellStyle12.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle12.Format = "###,0";
			this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle12;
			this.dataGridViewTextBoxColumn3.HeaderText = "Giá nhập";
			this.dataGridViewTextBoxColumn3.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
			this.dataGridViewTextBoxColumn3.ReadOnly = true;
			this.dataGridViewTextBoxColumn3.Width = 90;
			this.dataGridViewTextBoxColumn4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn4.DataPropertyName = "P_PriceTrade";
			dataGridViewCellStyle13.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle13.Format = "###,0";
			dataGridViewCellStyle13.NullValue = null;
			this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle13;
			this.dataGridViewTextBoxColumn4.HeaderText = "Giá bán buôn";
			this.dataGridViewTextBoxColumn4.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
			this.dataGridViewTextBoxColumn4.ReadOnly = true;
			this.dataGridViewTextBoxColumn4.Width = 90;
			this.dataGridViewTextBoxColumn5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn5.DataPropertyName = "P_PriceRetail";
			dataGridViewCellStyle14.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle14.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle14.Format = "###,0";
			this.dataGridViewTextBoxColumn5.DefaultCellStyle = dataGridViewCellStyle14;
			this.dataGridViewTextBoxColumn5.HeaderText = "Giá bán lẻ";
			this.dataGridViewTextBoxColumn5.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
			this.dataGridViewTextBoxColumn5.ReadOnly = true;
			this.dataGridViewTextBoxColumn5.Width = 90;
			this.dataGridViewTextBoxColumn6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn6.DataPropertyName = "PID";
			dataGridViewCellStyle15.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle15.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle15.Format = "###,0";
			this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle15;
			this.dataGridViewTextBoxColumn6.HeaderText = "PID";
			this.dataGridViewTextBoxColumn6.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
			this.dataGridViewTextBoxColumn6.ReadOnly = true;
			this.dataGridViewTextBoxColumn6.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn6.Visible = false;
			this.dataGridViewTextBoxColumn6.Width = 90;
			this.dataGridViewTextBoxColumn7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn7.DataPropertyName = "MinBalance";
			dataGridViewCellStyle16.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle16.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle16.ForeColor = Color.Blue;
			this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle16;
			this.dataGridViewTextBoxColumn7.HeaderText = "Tồn tối thiểu";
			this.dataGridViewTextBoxColumn7.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
			this.dataGridViewTextBoxColumn7.ReadOnly = true;
			this.dataGridViewTextBoxColumn7.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn7.Visible = false;
			this.dataGridViewTextBoxColumn7.Width = 90;
			this.dataGridViewTextBoxColumn8.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn8.DataPropertyName = "MaxBalance";
			dataGridViewCellStyle17.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle17.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle17.ForeColor = Color.Red;
			this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle17;
			this.dataGridViewTextBoxColumn8.HeaderText = "Tồn tối đa";
			this.dataGridViewTextBoxColumn8.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
			this.dataGridViewTextBoxColumn8.ReadOnly = true;
			this.dataGridViewTextBoxColumn8.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn8.Visible = false;
			this.dataGridViewTextBoxColumn8.Width = 90;
			this.dataGridViewTextBoxColumn9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn9.DataPropertyName = "MaxBalance";
			dataGridViewCellStyle18.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle18.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle18.ForeColor = Color.Red;
			this.dataGridViewTextBoxColumn9.DefaultCellStyle = dataGridViewCellStyle18;
			this.dataGridViewTextBoxColumn9.HeaderText = "Tồn tối đa";
			this.dataGridViewTextBoxColumn9.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
			this.dataGridViewTextBoxColumn9.ReadOnly = true;
			this.dataGridViewTextBoxColumn9.Width = 90;
			this.dataGridViewTextBoxColumn10.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn10.DataPropertyName = "MaxBalance";
			dataGridViewCellStyle19.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle19.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle19.ForeColor = Color.Red;
			this.dataGridViewTextBoxColumn10.DefaultCellStyle = dataGridViewCellStyle19;
			this.dataGridViewTextBoxColumn10.HeaderText = "Tồn tối đa";
			this.dataGridViewTextBoxColumn10.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
			this.dataGridViewTextBoxColumn10.Width = 90;
			this.label3.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.label3.BackColor = Color.White;
			this.label3.Location = new Point(-2, 0);
			this.label3.Name = "label3";
			this.label3.Size = new Size(905, 52);
			this.label3.TabIndex = 782;
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			this.BackgroundImageLayout = ImageLayout.Stretch;
			base.ClientSize = new Size(900, 600);
			base.Controls.Add(this.ckbFocusMind);
			base.Controls.Add(this.ckbSellWithBill);
			base.Controls.Add(this.bindingNavigator1);
			base.Controls.Add(this.btnSetBarcode);
			base.Controls.Add(this.txtBarcode);
			base.Controls.Add(this.label20);
			base.Controls.Add(this.btnAddSave);
			base.Controls.Add(this.label6);
			base.Controls.Add(this.btnShowAll);
			base.Controls.Add(this.txtSearch);
			base.Controls.Add(this.label2);
			base.Controls.Add(this.cbbList);
			base.Controls.Add(this.ckbWarm);
			base.Controls.Add(this.groupBox2);
			base.Controls.Add(this.dgvRep);
			base.Controls.Add(this.ckbLight);
			base.Controls.Add(this.btnDel);
			base.Controls.Add(this.tSBClose);
			base.Controls.Add(this.cbbSaveCondition);
			base.Controls.Add(this.tSBSave);
			base.Controls.Add(this.label9);
			base.Controls.Add(this.tSBAdd);
			base.Controls.Add(this.label7);
			base.Controls.Add(this.txtInputPrice);
			base.Controls.Add(this.txtreTailPrice);
			base.Controls.Add(this.label8);
			base.Controls.Add(this.txtSalePrice);
			base.Controls.Add(this.ckbKipChildren);
			base.Controls.Add(this.lblSpace);
			base.Controls.Add(this.label3);
			this.DoubleBuffered = true;
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.MaximizeBox = false;
			base.MinimizeBox = false;
			this.MinimumSize = new Size(900, 600);
			base.Name = "FrmupdtProduct";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "THUỐC VẬT TƯ";
			base.Load += new EventHandler(this.FrmupdtProduct_Load);
			base.Shown += new EventHandler(this.FrmupdtProduct_Shown);
			base.KeyDown += new KeyEventHandler(this.FrmupdtProduct_KeyDown);
			((ISupportInitialize)this.dgvRep).EndInit();
			this.contextMenuStrip1.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.groupBox2.PerformLayout();
			((ISupportInitialize)this.bindingNavigator1).EndInit();
			this.bindingNavigator1.ResumeLayout(false);
			this.bindingNavigator1.PerformLayout();
			base.ResumeLayout(false);
			base.PerformLayout();
		}
		public FrmupdtProduct()
		{
			this.InitializeComponent();
			this.txtName.Focus();
		}
		private void tSBClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void FrmupdtProduct_Load(object sender, EventArgs e)
		{
			this.objFunc.LoadComboBox("SELECT GpID, UPPER(GpName) AS GpName FROM TabGproducts ORDER BY [GpName]", this.cbbParentGID, "GpID", "GpName");
			this.objFunc.LoadComboBox("SELECT ID, UPPER(Name) AS Name FROM [TabPossition] ORDER BY [Name]", this.cbbPosition, "ID", "Name");
			this.objFunc.LoadComboBox("SELECT Man_ID, Man_Name FROM TabManufacture ORDER BY OrderBy", this.cbBCompany, "Man_ID", "Man_Name");
			this.objFunc.LoadComboBox("SELECT UnitID, UPPER(UnitName) AS UnitName FROM TabUnitProduct", this.cbbUnitProduct, "UnitID", "UnitName");
			this.objFunc.LoadComboBox("SELECT * FROM [TabSaveCondition] ORDER BY [Name]", this.cbbSaveCondition, "ID", "Name");
			try
			{
				this.cbbList.SelectedIndex = 1;
			}
			catch
			{
			}
			this.loaded = true;
			this.txtName.Focus();
		}
		public void getGroupProduct()
		{
			int num = 1;
			this.objTable = new DataTable();
			DataColumn column = new DataColumn("GpID", typeof(string));
			DataColumn column2 = new DataColumn("GroupName", typeof(string));
			DataColumn column3 = new DataColumn("PID", typeof(string));
			DataColumn column4 = new DataColumn("P_Name", typeof(string));
			DataColumn column5 = new DataColumn("P_PriceBase", typeof(string));
			DataColumn column6 = new DataColumn("P_PriceTrade", typeof(string));
			DataColumn column7 = new DataColumn("P_PriceRetail", typeof(string));
			DataColumn column8 = new DataColumn("UnitName", typeof(string));
			DataColumn column9 = new DataColumn("MinBalance", typeof(string));
			DataColumn column10 = new DataColumn("MaxBalance", typeof(string));
			this.objTable.Columns.Add(column);
			this.objTable.Columns.Add(column2);
			this.objTable.Columns.Add(column3);
			this.objTable.Columns.Add(column4);
			this.objTable.Columns.Add(column5);
			this.objTable.Columns.Add(column6);
			this.objTable.Columns.Add(column7);
			this.objTable.Columns.Add(column8);
			this.objTable.Columns.Add(column9);
			this.objTable.Columns.Add(column10);
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			string text;
			if (this.currGroup == 0)
			{
				text = "";
			}
			else
			{
				text = " AND GpID = " + this.currGroup;
			}
			string text2;
			if (this.txtSearch.Text != "")
			{
				text2 = string.Concat(new string[]
				{
					" AND (Upper(TabProducts.P_Name) LIKE N'%",
					this.txtSearch.Text.ToUpper(),
					"%' OR Upper(TabProducts.NameSearch) LIKE N'%",
					this.txtSearch.Text.ToUpper(),
					"%' ) "
				});
			}
			else
			{
				text2 = " ";
			}
			string cmdText;
			if (this.cbbList.SelectedIndex == 0)
			{
				cmdText = string.Concat(new string[]
				{
					"SELECT GpID, GpName FROM TabGProducts WHERE gpID IN (SELECT GpID FROM TabProducts WHERE 1 = 1 ",
					text2,
					") ",
					text,
					" ORDER By GpName"
				});
			}
			else
			{
				cmdText = string.Concat(new string[]
				{
					"SELECT GpID, GpName FROM TabGProducts WHERE gpID IN (SELECT GpID FROM TabProducts WHERE SUBSTRING([TabProducts].[P_name], 1, 1) = '",
					this.cbbList.Text.Replace("------ ", ""),
					"') ",
					text,
					" ORDER By GpName"
				});
			}
			SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			while (sqlDataReader.Read())
			{
				this.objTable.Rows.Add(new object[]
				{
					sqlDataReader["GpID"].ToString(),
					num.ToString() + " - " + sqlDataReader["GpName"].ToString(),
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					""
				});
				this.getProducts(sqlDataReader["GpID"].ToString(), sqlDataReader["GpName"].ToString());
				num++;
			}
			sqlDataReader.Close();
			sqlConnection.Close();
			sqlConnection.Dispose();
			BindingSource bindingSource = new BindingSource();
			bindingSource.DataSource = this.objTable;
			this.bindingNavigator1.BindingSource = bindingSource;
			this.dgvRep.DataSource = bindingSource;
		}
		public void getProducts(string GpID, string GpName)
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			string str;
			if (this.txtSearch.Text != "")
			{
				str = string.Concat(new string[]
				{
					" AND (Upper(TabProducts.P_Name) LIKE N'%",
					this.txtSearch.Text.ToUpper(),
					"%' OR Upper(TabProducts.NameSearch) LIKE N'%",
					this.txtSearch.Text.ToUpper(),
					"%' ) "
				});
			}
			else
			{
				str = " ";
			}
			string cmdText;
			if (this.cbbList.SelectedIndex == 0)
			{
				cmdText = "SELECT TOP 100 PID,P_Name,P_PriceBase,P_PriceTrade,P_PriceRetail,UPPER(UnitName) AS UnitName, MinBalance, MaxBalance FROM [TabProducts],[TabUnitProduct] WHERE [TabProducts].[P_DonViTinh] = [TabUnitProduct].[UnitID] AND [GpID] = " + GpID + str + " ORDER BY [P_Name]";
			}
			else
			{
				cmdText = string.Concat(new string[]
				{
					"SELECT TOP 100 PID,P_Name,P_PriceBase,P_PriceTrade,P_PriceRetail,UPPER(UnitName) AS UnitName, MinBalance, MaxBalance FROM [TabProducts],[TabUnitProduct] WHERE SUBSTRING([TabProducts].[P_name], 1, 1) = '",
					this.cbbList.Text.Replace("------ ", ""),
					"' AND [TabProducts].[P_DonViTinh] = [TabUnitProduct].[UnitID] AND [GpID] = ",
					GpID,
					" ORDER BY [P_Name]"
				});
			}
			SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			while (sqlDataReader.Read())
			{
				this.objTable.Rows.Add(new object[]
				{
					"",
					"",
					sqlDataReader["PID"].ToString(),
					sqlDataReader["P_Name"].ToString(),
					sqlDataReader["P_PriceBase"].ToString(),
					sqlDataReader["P_PriceTrade"].ToString(),
					sqlDataReader["P_PriceRetail"].ToString(),
					sqlDataReader["UnitName"].ToString(),
					sqlDataReader["MinBalance"].ToString(),
					sqlDataReader["MaxBalance"].ToString()
				});
			}
			sqlConnection.Close();
			sqlConnection.Dispose();
		}
		private void tSBAdd_Click(object sender, EventArgs e)
		{
			this.txtName.Text = "";
			this.txtInputPrice.Text = "0";
			this.txtMinimumNumber.Text = "0";
			this.txtRequestNumber.Text = "0";
			this.txtreTailPrice.Text = "0";
			this.ckbKipChildren.Checked = false;
			this.ckbLight.Checked = false;
			this.ckbWarm.Checked = false;
			this.cbbSaveCondition.SelectedIndex = 0;
			if (this.cbbUnitProduct.Items.Count > 0)
			{
				this.cbbUnitProduct.SelectedIndex = 0;
			}
			this.txtSalePrice.Text = "0";
			this.ProductID = 0;
			this.txtName.Focus();
		}
		private void setNew()
		{
			this.txtName.Text = "";
			this.txtInputPrice.Text = "0";
			this.txtMinimumNumber.Text = "";
			this.txtRequestNumber.Text = "";
			this.txtreTailPrice.Text = "0";
			if (this.cbbUnitProduct.Items.Count > 0)
			{
				this.cbbUnitProduct.SelectedIndex = 0;
			}
			this.txtSalePrice.Text = "0";
			this.ProductID = 0;
		}
		private void OnUpdate(int _act)
		{
			try
			{
				if (this.txtName.Text.Trim() == string.Empty)
				{
					MessageBox.Show("Hãy nhập tên cho sản phẩm cần quản lý", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
					this.txtName.Focus();
				}
				else
				{
					if (this.txtInputPrice.Text.Trim() == string.Empty)
					{
						MessageBox.Show("Cung cấp một giá nhập cho sản phẩm hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
						this.txtInputPrice.Focus();
					}
					else
					{
						if (this.txtSalePrice.Text.Trim() == string.Empty)
						{
							MessageBox.Show("Cung cấp giá bán buôn cho sản phẩm hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
							this.txtSalePrice.Focus();
						}
						else
						{
							if (this.txtreTailPrice.Text.Trim() == string.Empty)
							{
								MessageBox.Show("Cung cấp giá bán lẻ cho sản phẩm hiện tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
								this.txtreTailPrice.Focus();
							}
							else
							{
								if (this.cbBCompany.Text.Trim() == string.Empty)
								{
									MessageBox.Show("Hãy chọn nhà sản xuất sản phẩm", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
									this.cbBCompany.Focus();
								}
								else
								{
									SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
									SqlCommand sqlCommand = new SqlCommand("ActionOnTabProducts", sqlConnection);
									sqlCommand.CommandType = CommandType.StoredProcedure;
									sqlCommand.Parameters.Add("@PID", SqlDbType.Int);
									sqlCommand.Parameters["@PID"].Direction = ParameterDirection.InputOutput;
									sqlCommand.Parameters.Add("@GpID", SqlDbType.Int);
									sqlCommand.Parameters.Add("@ManID", SqlDbType.NVarChar);
									sqlCommand.Parameters.Add("@P_Name", SqlDbType.NVarChar, 200);
									sqlCommand.Parameters.Add("@P_DonViTinh", SqlDbType.Int);
									sqlCommand.Parameters.Add("@P_PriceBase", SqlDbType.Float);
									sqlCommand.Parameters.Add("@P_PriceRetail", SqlDbType.Float);
									sqlCommand.Parameters.Add("@P_PriceTrade", SqlDbType.Float);
									sqlCommand.Parameters.Add("@MinBalance", SqlDbType.Int);
									sqlCommand.Parameters.Add("@MaxBalance", SqlDbType.Int);
									sqlCommand.Parameters.Add("@KipLight", SqlDbType.SmallInt);
									sqlCommand.Parameters.Add("@KipWarm", SqlDbType.SmallInt);
									sqlCommand.Parameters.Add("@KipChildren", SqlDbType.SmallInt);
									sqlCommand.Parameters.Add("@KipSaveCondition", SqlDbType.VarChar, 50);
									sqlCommand.Parameters.Add("@NameSearch", SqlDbType.VarChar, 50);
									sqlCommand.Parameters.Add("@Act", SqlDbType.SmallInt);
									sqlCommand.Parameters.Add("@possID", SqlDbType.Int);
									sqlCommand.Parameters.Add("@possName", SqlDbType.NVarChar);
									sqlCommand.Parameters.Add("@DayLive", SqlDbType.Int);
									sqlCommand.Parameters.Add("@DayNumberWarning", SqlDbType.Int);
									sqlCommand.Parameters.Add("@NumberWarning", SqlDbType.Int);
									sqlCommand.Parameters.Add("@InfoInclude", SqlDbType.NVarChar);
									sqlCommand.Parameters.Add("@Barcode", SqlDbType.VarChar);
									sqlCommand.Parameters.Add("@SellWithBill", SqlDbType.SmallInt);
									sqlCommand.Parameters.Add("@FocusMind", SqlDbType.SmallInt);
									sqlCommand.Parameters["@PID"].Value = this.ProductID;
									try
									{
										sqlCommand.Parameters["@GpID"].Value = this.cbbParentGID.SelectedValue;
									}
									catch
									{
										sqlCommand.Parameters["@GpID"].Value = 0;
									}
									sqlCommand.Parameters["@ManID"].Value = this.cbBCompany.SelectedValue.ToString();
									sqlCommand.Parameters["@P_Name"].Value = this.txtName.Text;
									try
									{
										sqlCommand.Parameters["@P_DonViTinh"].Value = int.Parse(this.cbbUnitProduct.SelectedValue.ToString());
									}
									catch
									{
										sqlCommand.Parameters["@P_DonViTinh"].Value = 0;
									}
									try
									{
										double num = double.Parse(this.txtInputPrice.Text.Replace(".", "").Replace(",", ""));
										sqlCommand.Parameters["@P_PriceBase"].Value = num;
									}
									catch
									{
										sqlCommand.Parameters["@P_PriceBase"].Value = "0";
									}
									try
									{
										double num2 = double.Parse(this.txtSalePrice.Text.Replace(".", "").Replace(",", ""));
										sqlCommand.Parameters["@P_PriceTrade"].Value = num2;
									}
									catch
									{
										sqlCommand.Parameters["@P_PriceTrade"].Value = "0";
									}
									try
									{
										double num3 = double.Parse(this.txtreTailPrice.Text.Replace(".", "").Replace(",", ""));
										sqlCommand.Parameters["@P_PriceRetail"].Value = num3;
									}
									catch
									{
										sqlCommand.Parameters["@P_PriceRetail"].Value = "0";
									}
									try
									{
										sqlCommand.Parameters["@MinBalance"].Value = int.Parse(this.txtMinimumNumber.Text);
									}
									catch
									{
										sqlCommand.Parameters["@MinBalance"].Value = 0;
									}
									try
									{
										sqlCommand.Parameters["@MaxBalance"].Value = int.Parse(this.txtRequestNumber.Text);
									}
									catch
									{
										sqlCommand.Parameters["@MaxBalance"].Value = 0;
									}
									if (this.ckbLight.Checked)
									{
										sqlCommand.Parameters["@KipLight"].Value = 1;
									}
									else
									{
										sqlCommand.Parameters["@KipLight"].Value = 0;
									}
									if (this.ckbWarm.Checked)
									{
										sqlCommand.Parameters["@KipWarm"].Value = 1;
									}
									else
									{
										sqlCommand.Parameters["@KipWarm"].Value = 0;
									}
									if (this.ckbKipChildren.Checked)
									{
										sqlCommand.Parameters["@KipChildren"].Value = 1;
									}
									else
									{
										sqlCommand.Parameters["@KipChildren"].Value = 0;
									}
									sqlCommand.Parameters["@KipSaveCondition"].Value = this.cbbSaveCondition.SelectedValue.ToString();
									sqlCommand.Parameters["@NameSearch"].Value = this.NameForSearch(this.txtName.Text.Trim());
									sqlCommand.Parameters["@Act"].Value = _act;
									sqlCommand.Parameters["@possID"].Value = this.cbbPosition.SelectedValue.ToString();
									sqlCommand.Parameters["@possName"].Value = this.cbbPosition.Text.ToString();
									try
									{
										sqlCommand.Parameters["@DayLive"].Value = int.Parse(this.txtLiveDay.Text);
									}
									catch
									{
										sqlCommand.Parameters["@DayLive"].Value = 0;
									}
									try
									{
										sqlCommand.Parameters["@DayNumberWarning"].Value = int.Parse(this.txtDayNumberWarning.Text);
									}
									catch
									{
										sqlCommand.Parameters["@DayNumberWarning"].Value = 0;
									}
									try
									{
										sqlCommand.Parameters["@NumberWarning"].Value = int.Parse(this.txtNumberWarning.Text);
									}
									catch
									{
										sqlCommand.Parameters["@NumberWarning"].Value = 0;
									}
									sqlCommand.Parameters["@InfoInclude"].Value = "";
									sqlCommand.Parameters["@Barcode"].Value = this.txtBarcode.Text;
									if (this.ckbSellWithBill.Checked)
									{
										sqlCommand.Parameters["@SellWithBill"].Value = 1;
									}
									else
									{
										sqlCommand.Parameters["@SellWithBill"].Value = 0;
									}
									if (this.ckbFocusMind.Checked)
									{
										sqlCommand.Parameters["@FocusMind"].Value = 1;
									}
									else
									{
										sqlCommand.Parameters["@FocusMind"].Value = 0;
									}
									sqlConnection.Open();
									sqlCommand.ExecuteNonQuery();
									if (this.ProductID != 0)
									{
										SqlCommand sqlCommand2 = sqlConnection.CreateCommand();
										sqlCommand2.CommandText = "UPDATE [TabDetailBill] SET [productName] = N'" + this.txtName.Text + "' WHERE [Pid] = " + this.ProductID.ToString();
										sqlCommand2.ExecuteNonQuery();
										sqlCommand2.CommandText = string.Concat(new string[]
										{
											"UPDATE [TabTotalBalancer] SET [productName] = N'",
											this.txtName.Text,
											"', [MinBalance] = ",
											this.txtMinimumNumber.Text,
											", [MaxBalance] = ",
											this.txtRequestNumber.Text,
											" WHERE [Pid] = ",
											this.ProductID.ToString()
										});
										sqlCommand2.ExecuteNonQuery();
										this.objP.forWardPossition(this.ProductID.ToString(), this.cbbPosition.SelectedValue.ToString(), this.cbbPosition.Text);
									}
									this.ProductID = int.Parse(sqlCommand.Parameters["@PID"].Value.ToString());
									string text = this.ProductID.ToString();
									sqlConnection.Close();
									sqlConnection.Dispose();
									this.NameOfNewProduct = this.txtName.Text;
									if (_act == 0)
									{
										try
										{
											this.getGroupProduct();
										}
										catch
										{
										}
									}
									else
									{
										this.dgvRep.Rows[this.CurrIndex].Cells["dg2"].Value = this.txtName.Text;
										this.dgvRep.Rows[this.CurrIndex].Cells["Column1"].Value = this.cbbUnitProduct.Text;
										this.dgvRep.Rows[this.CurrIndex].Cells["Column2"].Value = this.txtMinimumNumber.Text;
										this.dgvRep.Rows[this.CurrIndex].Cells["Column3"].Value = this.txtRequestNumber.Text;
									}
									MessageBox.Show("Thông tin đã được lưu vào cơ sở dữ liệu", "TVS GPP - Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
								}
							}
						}
					}
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
		private void InsertProductFirst(int tmpID, string tmpName)
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			SqlConnection sqlConnection2 = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			SqlCommand sqlCommand = new SqlCommand("InsertProductToWareProduct", sqlConnection);
			sqlCommand.CommandType = CommandType.StoredProcedure;
			sqlCommand.Parameters.Add("@whID", SqlDbType.VarChar, 50);
			sqlCommand.Parameters.Add("@pID", SqlDbType.Int);
			sqlCommand.Parameters.Add("@pName", SqlDbType.NVarChar, 300);
			sqlCommand.Parameters.Add("@Month", SqlDbType.SmallInt);
			sqlCommand.Parameters.Add("@Year", SqlDbType.Int);
			SqlCommand sqlCommand2 = new SqlCommand("SELECT DISTINCT WareHouse_ID FROM TabWareHouse ", sqlConnection2);
			sqlConnection2.Open();
			SqlDataReader sqlDataReader = sqlCommand2.ExecuteReader();
			if (sqlDataReader.HasRows)
			{
				while (sqlDataReader.Read())
				{
					sqlCommand.Parameters["@whID"].Value = sqlDataReader["WareHouse_ID"].ToString();
					sqlCommand.Parameters["@pID"].Value = tmpID;
					sqlCommand.Parameters["@pName"].Value = tmpName;
					sqlCommand.Parameters["@Month"].Value = DateTime.Now.Month;
					sqlCommand.Parameters["@Year"].Value = DateTime.Now.Year;
					sqlCommand.ExecuteNonQuery();
				}
			}
			sqlDataReader.Close();
			sqlDataReader.Dispose();
			sqlConnection2.Close();
			sqlConnection.Close();
			sqlConnection2.Dispose();
			sqlConnection.Dispose();
		}
		private void txtInputPrice_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtSalePrice.Focus();
			}
		}
		private void txtSalePrice_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtreTailPrice.Focus();
			}
		}
		private void txtreTailPrice_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
			}
		}
		private void txtRequestNumber_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (!char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar))
			{
				e.Handled = true;
			}
			if (e.KeyChar == '\r')
			{
				this.txtMinimumNumber.Focus();
			}
		}
		private void txtMinimumNumber_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (!char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar))
			{
				e.Handled = true;
			}
		}
		private void txtName_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.cbbUnitProduct.Focus();
			}
		}
		private void cbBCompany_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.cbbUnitProduct.Focus();
			}
		}
		private void txtUnit_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtInputPrice.Focus();
			}
		}
		private void txtRealSalePrice_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtreTailPrice.Focus();
			}
		}
		private void txtRealretailPrice_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
			}
		}
		private void txtNote_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.tSBSave.PerformClick();
			}
		}
		private void tSBSave_Click(object sender, EventArgs e)
		{
			if (this.ProductID != 0)
			{
				this.OnUpdate(1);
				this.checkChange = true;
			}
			else
			{
				this.OnUpdate(0);
				this.checkChange = true;
			}
		}
		private void UpdateNameForSearch()
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			SqlConnection sqlConnection2 = new SqlConnection(Program.strConnectionString);
			SqlCommand sqlCommand = sqlConnection.CreateCommand();
			SqlCommand sqlCommand2 = sqlConnection2.CreateCommand();
			sqlCommand.CommandText = "SELECT PID,P_Name FROM TabProducts ";
			sqlConnection.Open();
			sqlConnection2.Open();
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			if (sqlDataReader.HasRows)
			{
				while (sqlDataReader.Read())
				{
					sqlCommand2.CommandText = "UPDATE [TabProducts] SET [NameSearch]='" + this.NameForSearch(sqlDataReader["P_Name"].ToString()) + "' WHERE [PID]=" + sqlDataReader["PID"].ToString();
					sqlCommand2.ExecuteNonQuery();
				}
			}
			sqlDataReader.Close();
			sqlDataReader.Dispose();
			sqlConnection2.Close();
			sqlConnection2.Dispose();
			sqlConnection.Close();
			sqlConnection.Dispose();
			MessageBox.Show("Bạn vừa thực hiện công việc lập mục tìm kiếm thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
		}
		private string NameForSearch(string RealName)
		{
			RealName = RealName.ToLower();
			RealName = RealName.Replace("ư", "u").Replace("ứ", "u").Replace("ự", "u").Replace("ử", "u").Replace("ừ", "u").Replace("ữ", "u");
			RealName = RealName.Replace("ú", "u").Replace("ụ", "u").Replace("ủ", "u").Replace("ù", "u").Replace("ũ", "u");
			RealName = RealName.Replace("á", "a").Replace("ạ", "a").Replace("ả", "a").Replace("à", "a").Replace("ã", "a");
			RealName = RealName.Replace("â", "a").Replace("ấ", "a").Replace("ẩ", "a").Replace("ầ", "a").Replace("ậ", "a").Replace("ẫ", "a");
			RealName = RealName.Replace("ă", "a").Replace("ắ", "a").Replace("ẳ", "a").Replace("ằ", "a").Replace("ặ", "a").Replace("ẵ", "a");
			RealName = RealName.Replace("ê", "e").Replace("ế", "e").Replace("ể", "e").Replace("ề", "e").Replace("ệ", "e").Replace("ễ", "e");
			RealName = RealName.Replace("é", "e").Replace("ẹ", "e").Replace("ẻ", "e").Replace("è", "e").Replace("ẽ", "e");
			RealName = RealName.Replace("í", "i").Replace("ị", "i").Replace("ỉ", "i").Replace("ì", "i").Replace("ĩ", "i");
			RealName = RealName.Replace("ý", "y").Replace("ỵ", "y").Replace("ỷ", "y").Replace("ỳ", "y").Replace("ỹ", "y");
			RealName = RealName.Replace("ó", "o").Replace("ỏ", "o").Replace("ò", "o").Replace("ọ", "o").Replace("õ", "o");
			RealName = RealName.Replace("đ", "d");
			RealName = RealName.Replace("ơ", "o").Replace("ớ", "o").Replace("ở", "o").Replace("ờ", "o").Replace("ợ", "o").Replace("ỡ", "o");
			RealName = RealName.Replace("ô", "o").Replace("ố", "o").Replace("ổ", "o").Replace("ồ", "o").Replace("ộ", "o").Replace("ỗ", "o");
			return RealName;
		}
		private void txtName_Enter(object sender, EventArgs e)
		{
			this.txtName.BackColor = Color.Aqua;
		}
		private void cbBCompany_Enter(object sender, EventArgs e)
		{
			this.cbBCompany.BackColor = Color.Aqua;
		}
		private void txtInputPrice_Enter(object sender, EventArgs e)
		{
			this.txtInputPrice.BackColor = Color.Aqua;
		}
		private void txtSalePrice_Enter(object sender, EventArgs e)
		{
			this.txtSalePrice.BackColor = Color.Aqua;
		}
		private void txtreTailPrice_Enter(object sender, EventArgs e)
		{
			this.txtreTailPrice.BackColor = Color.Aqua;
		}
		private void txtRequestNumber_Enter(object sender, EventArgs e)
		{
			this.txtRequestNumber.BackColor = Color.Aqua;
		}
		private void txtMinimumNumber_Enter(object sender, EventArgs e)
		{
			this.txtMinimumNumber.BackColor = Color.Aqua;
		}
		private void txtName_Leave(object sender, EventArgs e)
		{
			this.txtName.BackColor = Color.White;
		}
		private void cbBCompany_Leave(object sender, EventArgs e)
		{
			this.cbBCompany.BackColor = Color.White;
		}
		private void txtInputPrice_Leave(object sender, EventArgs e)
		{
			this.txtInputPrice.BackColor = Color.White;
		}
		private void txtSalePrice_Leave(object sender, EventArgs e)
		{
			this.txtSalePrice.BackColor = Color.White;
		}
		private void txtreTailPrice_Leave(object sender, EventArgs e)
		{
			this.txtreTailPrice.BackColor = Color.White;
		}
		private void txtRequestNumber_Leave(object sender, EventArgs e)
		{
			this.txtRequestNumber.BackColor = Color.White;
		}
		private void txtMinimumNumber_Leave(object sender, EventArgs e)
		{
			this.txtMinimumNumber.BackColor = Color.White;
		}
		public void DeleteProducts(int _PID)
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			SqlCommand sqlCommand = new SqlCommand("ActionOnTabProducts", sqlConnection);
			sqlCommand.CommandType = CommandType.StoredProcedure;
			sqlCommand.Parameters.Add("@PID", SqlDbType.Int);
			sqlCommand.Parameters.Add("@Act", SqlDbType.SmallInt);
			sqlCommand.Parameters["@PID"].Value = _PID;
			sqlCommand.Parameters["@Act"].Value = 2;
			sqlConnection.Open();
			sqlCommand.ExecuteNonQuery();
			sqlConnection.Close();
			sqlConnection.Dispose();
		}
		private bool CheckProductName(string productName, int tempPID)
		{
			bool result = false;
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			SqlCommand sqlCommand = new SqlCommand();
			sqlCommand.Connection = sqlConnection;
			sqlCommand.CommandText = string.Concat(new object[]
			{
				"SELECT TOP 1 P_Name FROM [TabProducts] WHERE [P_Name] = '",
				productName,
				"'  AND [PID]<>",
				tempPID
			});
			sqlConnection.Open();
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			if (sqlDataReader.HasRows)
			{
				result = true;
			}
			sqlDataReader.Close();
			sqlDataReader.Dispose();
			sqlConnection.Close();
			sqlConnection.Dispose();
			return result;
		}
		private void cbBgParent_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtName.Focus();
			}
		}
		private void cbbUnitProduct_Leave(object sender, EventArgs e)
		{
			this.cbbUnitProduct.BackColor = Color.White;
		}
		private void cbbUnitProduct_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtInputPrice.Focus();
			}
		}
		private void cbbUnitProduct_Enter(object sender, EventArgs e)
		{
			this.cbbUnitProduct.BackColor = Color.Aqua;
		}
		private void txtSearchFor_KeyPress(object sender, KeyPressEventArgs e)
		{
		}
		private void btnDel_Click(object sender, EventArgs e)
		{
			try
			{
				if (this.txtName.Text != "" && this.ProductID > 0)
				{
					if (MessageBox.Show("Có phải bạn muốn xoá mục được chọn không?\r\n\r\nBấm YES nếu đồng ý xoá, Bấm NO để bỏ qua!", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
					{
						string a = this.CheckProductExistInRep(this.ProductID.ToString());
						if (a != "")
						{
							MessageBox.Show("Mặt hàng \" " + this.txtName.Text + " \" đã có giao dịch ở các hóa đơn\r\n\r\nBạn phải xóa hết hóa đơn liên quan trước khi xoá mặt hàng!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
						}
						else
						{
							this.deleteProduct(this.ProductID.ToString());
							try
							{
								this.getGroupProduct();
							}
							catch
							{
							}
						}
					}
				}
			}
			catch
			{
			}
		}
		public void deleteProduct(string id)
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			SqlCommand sqlCommand = new SqlCommand("DelProducts", sqlConnection);
			sqlCommand.CommandType = CommandType.StoredProcedure;
			sqlCommand.Parameters.Add("ID", SqlDbType.VarChar);
			sqlCommand.Parameters["ID"].Value = id;
			sqlCommand.ExecuteNonQuery();
			sqlConnection.Close();
			sqlConnection.Dispose();
		}
		private string CheckProductExistInRep(string Pid)
		{
			string result = "";
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			try
			{
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				sqlCommand.CommandText = "SELECT TOP 1 [BillID] FROM [TabDetailBill] WHERE [Pid]=" + Pid;
				SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
				while (sqlDataReader.Read())
				{
					result = sqlDataReader["BillID"].ToString();
				}
				sqlDataReader.Close();
				sqlDataReader.Dispose();
			}
			catch
			{
			}
			sqlConnection.Close();
			sqlConnection.Dispose();
			return result;
		}
		private void cbbParentGID_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtName.Focus();
			}
		}
		private void txtRequestNumber_KeyPress_1(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtMinimumNumber.Focus();
			}
		}
		private void txtMinimumNumber_KeyPress_1(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.cbbSaveCondition.Focus();
			}
		}
		private void tSBSave_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.tSBAdd.PerformClick();
			}
		}
		private void txtBarcode_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.cbbParentGID.Focus();
			}
		}
		private void cbbParentGID_Enter(object sender, EventArgs e)
		{
			this.cbbParentGID.BackColor = Color.Aqua;
		}
		private void txtRequestNumber_Enter_1(object sender, EventArgs e)
		{
			this.txtRequestNumber.BackColor = Color.Aqua;
		}
		private void txtMinimumNumber_Enter_1(object sender, EventArgs e)
		{
			this.txtMinimumNumber.BackColor = Color.Aqua;
		}
		private void cbbParentGID_Leave(object sender, EventArgs e)
		{
			this.cbbParentGID.BackColor = Color.White;
		}
		private void txtRequestNumber_Leave_1(object sender, EventArgs e)
		{
			this.txtRequestNumber.BackColor = Color.White;
		}
		private void txtMinimumNumber_Leave_1(object sender, EventArgs e)
		{
			this.txtMinimumNumber.BackColor = Color.White;
		}
		private void FrmupdtProduct_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.F4)
			{
				this.tSBAdd.PerformClick();
			}
			else
			{
				if (e.KeyCode == Keys.F6)
				{
					this.tSBSave.PerformClick();
				}
				else
				{
					if (e.KeyCode == Keys.F8)
					{
						this.btnDel.PerformClick();
					}
					else
					{
						if (e.KeyCode == Keys.F10)
						{
							this.UpdateNameForSearch();
						}
						else
						{
							if (e.KeyCode == Keys.Escape)
							{
								base.Close();
							}
						}
					}
				}
			}
		}
		private void cbPromote_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.tSBSave.PerformClick();
			}
		}
		private void txtPromote_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtRequestNumber.Focus();
			}
		}
		private void btnAddNewUnit_Click(object sender, EventArgs e)
		{
			new FrmupdtUnitproduct
			{
				Size = new Size(500, 300),
				StartPosition = FormStartPosition.Manual,
				FormBorderStyle = FormBorderStyle.FixedToolWindow//,
				//StartPosition = FormStartPosition.CenterScreen
			}.ShowDialog();
			this.cbbUnitProduct.DataSource = null;
			this.cbbUnitProduct.Items.Clear();
			this.objFunc.LoadComboBox("SELECT UnitID, UPPER(UnitName) AS UnitName FROM TabUnitProduct", this.cbbUnitProduct, "UnitID", "UnitName");
		}
		private void btnFastGroupProduct_Click(object sender, EventArgs e)
		{
			new FrmupdtGproduct
			{
				Size = new Size(500, 300),
				StartPosition = FormStartPosition.Manual,
				FormBorderStyle = FormBorderStyle.FixedToolWindow//,
				//StartPosition = FormStartPosition.CenterScreen
			}.ShowDialog();
			this.cbbParentGID.DataSource = null;
			this.cbbParentGID.Items.Clear();
			this.objFunc.LoadComboBox("SELECT GpID, UPPER(GpName) AS GpName FROM TabGproducts", this.cbbParentGID, "GpID", "GpName");
		}
		private void dgvRep_CellEnter(object sender, DataGridViewCellEventArgs e)
		{
			if (this.loaded)
			{
				try
				{
					if (this.dgvRep.Rows[e.RowIndex].Cells["GroupName"].Value.ToString() != "")
					{
						try
						{
							this.currGroup = int.Parse(this.dgvRep.Rows[e.RowIndex].Cells["GpID"].Value.ToString());
						}
						catch (Exception ex)
						{
							MessageBox.Show(ex.Message);
							this.currGroup = 0;
						}
					}
					else
					{
						this.CurrIndex = this.dgvRep.CurrentRow.Index;
						this.ProductID = int.Parse(this.dgvRep.Rows[this.dgvRep.CurrentRow.Index].Cells["dg6"].Value.ToString());
						this.getInfomation(this.ProductID.ToString());
						try
						{
							this.currGroup = int.Parse(this.dgvRep.Rows[this.CurrIndex].Cells["GpID"].ToString());
						}
						catch
						{
							this.currGroup = 0;
						}
					}
				}
				catch
				{
				}
			}
		}
		public void getInfomation(string pID)
		{
			GProduct gProduct = new GProduct();
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			SqlCommand sqlCommand = new SqlCommand();
			sqlCommand.Connection = sqlConnection;
			sqlCommand.CommandText = "SELECT * FROM TabProducts WHERE PID = " + pID;
			sqlConnection.Open();
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			if (sqlDataReader.HasRows)
			{
				while (sqlDataReader.Read())
				{
					try
					{
						this.cbbParentGID.SelectedValue = sqlDataReader["GpID"].ToString();
					}
					catch
					{
						this.cbbParentGID.SelectedIndex = 0;
					}
					try
					{
						this.cbBCompany.SelectedValue = sqlDataReader["ManID"].ToString();
					}
					catch
					{
						this.cbBCompany.SelectedIndex = 0;
					}
					this.txtName.Text = sqlDataReader["P_Name"].ToString();
					this.txtBarcode.Text = sqlDataReader["Barcode"].ToString();
					this.cbbUnitProduct.SelectedValue = sqlDataReader["P_DonViTinh"].ToString();
					this.txtInputPrice.Text = string.Format(Program.lenAffterDecimal, double.Parse(sqlDataReader["P_PriceBase"].ToString()));
					this.txtSalePrice.Text = string.Format(Program.lenAffterDecimal, double.Parse(sqlDataReader["P_PriceTrade"].ToString()));
					this.txtreTailPrice.Text = string.Format(Program.lenAffterDecimal, double.Parse(sqlDataReader["P_PriceRetail"].ToString()));
					this.txtRequestNumber.Text = sqlDataReader["MaxBalance"].ToString();
					this.txtMinimumNumber.Text = sqlDataReader["MinBalance"].ToString();
					this.cbbSaveCondition.SelectedValue = sqlDataReader["KipSaveCondition"].ToString();
					this.cbbPosition.SelectedValue = sqlDataReader["possID"].ToString();
					this.txtLiveDay.Text = sqlDataReader["DayLive"].ToString();
					this.txtDayNumberWarning.Text = sqlDataReader["DayNumberWarning"].ToString();
					this.txtNumberWarning.Text = sqlDataReader["NumberWarning"].ToString();
					if (sqlDataReader["KipLight"].ToString() == "1")
					{
						this.ckbLight.Checked = true;
					}
					else
					{
						this.ckbLight.Checked = false;
					}
					if (sqlDataReader["KipWarm"].ToString() == "1")
					{
						this.ckbWarm.Checked = true;
					}
					else
					{
						this.ckbWarm.Checked = false;
					}
					if (sqlDataReader["KipChildren"].ToString() == "1")
					{
						this.ckbKipChildren.Checked = true;
					}
					else
					{
						this.ckbKipChildren.Checked = false;
					}
					if (sqlDataReader["SellWithBill"].ToString() == "1")
					{
						this.ckbSellWithBill.Checked = true;
					}
					else
					{
						this.ckbSellWithBill.Checked = false;
					}
					if (sqlDataReader["FocusMind"].ToString() == "1")
					{
						this.ckbFocusMind.Checked = true;
					}
					else
					{
						this.ckbFocusMind.Checked = false;
					}
				}
			}
			sqlDataReader.Close();
			sqlDataReader.Dispose();
			sqlConnection.Close();
			sqlConnection.Dispose();
		}
		private void btnListDesease_Click(object sender, EventArgs e)
		{
			if (this.ProductID > 0)
			{
				new frmProductDesease
				{
					Pid = this.ProductID,
					lblProductName = 
					{
						Text = this.txtName.Text
					}
				}.ShowDialog();
			}
			else
			{
				MessageBox.Show("Bạn chưa chọn sản phẩm hoặc thêm mà chưa lưu thông tin về sản phẩm", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
		}
		private void cbbList_SelectedIndexChanged(object sender, EventArgs e)
		{
			this.getGroupProduct();
		}
		private void btnPossAdd_Click(object sender, EventArgs e)
		{
			frmupdtPossition frmupdtPossition = new frmupdtPossition();
			frmupdtPossition.ShowDialog();
			this.cbbPosition.DataSource = null;
			this.cbbPosition.Items.Clear();
			this.objFunc.LoadComboBox("SELECT ID, UPPER(Name) AS Name FROM [TabPossition]", this.cbbPosition, "ID", "Name");
		}
		private void txtSearch_TextChanged(object sender, EventArgs e)
		{
			if (this.loaded)
			{
				this.currGroup = 0;
				this.getGroupProduct();
			}
		}
		private void btnShowAll_Click(object sender, EventArgs e)
		{
			this.txtSearch.Text = "";
			this.getGroupProduct();
		}
		private void btnListUnit_Click(object sender, EventArgs e)
		{
			if (this.ProductID > 0)
			{
				try
				{
					new frmProductUnitList
					{
						Pid = this.ProductID,
						lblProductName = 
						{
							Text = this.txtName.Text
						},
						lblMainUnit = 
						{
							Text = "ĐƠN VỊ CHÍNH THỨC : " + this.cbbUnitProduct.Text
						}
					}.ShowDialog();
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message);
				}
			}
		}
		private void btnAddSave_Click(object sender, EventArgs e)
		{
			frmSaveCollection frmSaveCollection = new frmSaveCollection();
			frmSaveCollection.ShowDialog();
			this.cbbSaveCondition.DataSource = null;
			this.cbbSaveCondition.Items.Clear();
			this.objFunc.LoadComboBox("SELECT * FROM [TabSaveCondition] ORDER BY [Name]", this.cbbSaveCondition, "ID", "Name");
		}
		private void txtBarcode_KeyDown(object sender, KeyEventArgs e)
		{
			if (!(this.txtBarcode.Text.Trim() == ""))
			{
				if (e.KeyCode == Keys.Return)
				{
					this.btnSetBarcode.PerformClick();
				}
			}
		}
		private void btnSetBarcode_Click(object sender, EventArgs e)
		{
			if (this.ProductID > 0)
			{
				if (this.txtBarcode.Text.Trim() != "")
				{
					this.objP.setBarcode(this.ProductID.ToString(), this.txtBarcode.Text);
					MessageBox.Show("Gán mã vạch cho sản phẩm thành công !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				else
				{
					MessageBox.Show("Bạn chưa nhập mã vạch của sản phẩm !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
			}
			else
			{
				MessageBox.Show("Bạn chưa chọn sản phẩm hoặc thêm mà chưa lưu thông tin về sản phẩm", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
		}
		private void txtSearch_Enter(object sender, EventArgs e)
		{
			this.cbbList.SelectedIndex = 0;
		}
		private void mnuUsage_Click(object sender, EventArgs e)
		{
			if (this.ProductID > 0)
			{
				new frmProductDesease
				{
					Pid = this.ProductID,
					lblProductName = 
					{
						Text = this.txtName.Text
					}
				}.ShowDialog();
			}
			else
			{
				MessageBox.Show("Chọn sản phẩm cụ thể để xem công dụng", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
		}
		private void mnuIngredient_Click(object sender, EventArgs e)
		{
			try
			{
				if (this.ProductID > 0)
				{
					new frmProductIngredient
					{
						Pid = this.ProductID,
						lblProductName = 
						{
							Text = this.txtName.Text
						}
					}.ShowDialog();
				}
				else
				{
					MessageBox.Show("Chọn sản phẩm cụ thể để xem hoạt chất !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
			}
			catch
			{
			}
		}
		private void dgvRep_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
		{
		}
		private void mnuAdd_Click(object sender, EventArgs e)
		{
			this.tSBAdd.PerformClick();
		}
		private void mnuDel_Click(object sender, EventArgs e)
		{
			this.btnDel.PerformClick();
		}
		private void mnuUnit_Click(object sender, EventArgs e)
		{
			this.btnListUnit.PerformClick();
		}
		private void mnuShowOne_Click(object sender, EventArgs e)
		{
			this.getGroupProduct();
		}
		private void mnuShowAll_Click(object sender, EventArgs e)
		{
			this.currGroup = 0;
			this.getGroupProduct();
		}
		private void FrmupdtProduct_Shown(object sender, EventArgs e)
		{
			if (this.dgvRep.Rows.Count == 0)
			{
				this.btnShowAll.PerformClick();
			}
		}
	}
}
